Gestion des clés d'API REST d'Analytics

Clés d'API

Analytics utilise deux types de clés API :

Clé API système

Clés API étendues

GET /analytics/api/v1/apikeys

Renvoie : La liste des clés API étendues définies (autrement dit, NE liste PAS du tout les clés API système).

En-tête:

Autorisation : <SYSTEM API KEY>

Exemple :

[

{

"scope": "EVENTS",

"key": "UUID",

"client": 100,

"description": "some text"

}

]

La réponse est décrite selon ce schéma JSON :

{

"type": array,

"items": {

"type": "object",

"properties": {

"scope": {

"type": "string",

"enum": ["TELEMETRY", "EVENTS"]

},

"key": {

"type": "string"

},

"client": {

"type": "integer",

"description": "This is required for EVENTS keys, ignored for TELEMETRY keys"

},

"description": {

"type": "string"

}

},

"required": ["scope", "key"]

}

}

POST

Crée une nouvelle clé API.

POST /analytics/api/v1/apikeys

{

"scope": "EVENTS",

"client": 100,

"description": "some text"

}

Headers:

Authorization: <SYSTEM API KEY>

The POST body JSON schema:

{

"type": "object",

"properties": {

"scope": {

"type": "string",

"enum": ["TELEMETRY", "EVENTS"]

},

"client": {

"type": "integer",

"description": "This is required for EVENTS keys, ignored for TELEMETRY keys"

},

"description": {

"type": "string"

}

},

"required": ["scope"]

}

Réponse schéma JSON :

{

"type": "object",

"properties": {

"scope": {

"type": "string",

"enum": ["TELEMETRY", "EVENTS"]

},

"key": {

"type": "string"

},

"client": {

"type": "integer",

"description": "This is required for EVENTS keys, ignored for TELEMETRY keys"

},

"description": {

"type": "string"

}

},

"required": ["scope", "key"]

}

Exemple de réponse :

{

"key": "UUID",

"scope": "EVENTS",

"client": 100,

"description": "some text"

}

DELETE

Supprime une clé API.

DELETE: /analytics/api/v1/apikeys/<UUID>

En-tête:

Autorisation : <SYSTEM API KEY>

Voir aussi :