Core
Utiliser le Package NPM Core
La configuration du Core vous permet d'utiliser les méthodes du Core pour accéder à l'API du service.
AbyssMonitorCore.setConfig({
// Your Application Monitor API Key
applicationApiKey: "application-monitor-api-key",
// Your Application ID
applicationId: "application-id",
// Name showed on alerts
applicationName: 'My Super Application - API',
// This method should return an URl to post Alert
// You can return null/undefined if you want to not send alert
// Please check complete typing of payload on the Core Package
async getWebhookUrl(payload) {
return "my-discord-webhook-url";
},
// Can be found on your AbyssMonitor dashboard
// It's required to publish log remotely
secretPublishToken: "secret-publish-token",
});
// This method will enable automatic retry on failed http request to AbyssMonitor API
AbyssMonitorCore.enableAxiosRetry();
Standalone
Si vous n'utilisez pas le package NPM pour accéder à l'API, vous pouvez passer cette étape et simplement renseigner votre Clé API dans l'en-tête de la requête HTTP.
// HTTP Version
GET /api/user/me HTTP/1.1
Host: monitor-api.abyss-project.fr
abyss-monitor-api-key-application: "abyss-monitor-api-key-application"
// Curl Version
curl --location 'https://monitor-api.abyss-project.fr/api/user/me' \
--header 'abyss-monitor-api-key-application: abyss-monitor-api-key-application'
info
abyss-monitor-api-key-application: vous donne accès aux endpoints d'Application.