Last updated 1 year ago
Tokens from a project.
OK
const response = await fetch('https://cloud-api.calyptia.com/v1/projects/{projectID}/tokens', { method: 'GET', headers: { "Authorization": "Bearer <token>" }, }); const data = await response.json();
[ { "id": "123e4567-e89b-12d3-a456-426614174000", "token": "redacted", "name": "my-token", "createdAt": "2024-04-26T01:38:34.110Z" } ]
Create token within a project. These tokens are to authorize other applications to access the project. For example:
Created
const response = await fetch('https://cloud-api.calyptia.com/v1/projects/{projectID}/tokens', { method: 'POST', headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "new-token" }), }); const data = await response.json();
{ "id": "123e4567-e89b-12d3-a456-426614174000", "token": "redacted", "name": "my-token", "createdAt": "2024-04-26T01:38:34.110Z" }