Vai al contenuto
Accedi
Riferimento API
Risorsa

API Key Custom Role

The custom roles an API key is given. The key holds every permission of the role except those with the Owned scope: a key owns nothing.

Il Modello API Key Custom Role

Proprietà

  • Nome
    _id
    Tipo
    Object ID
    Descrizione

    ID of this object

  • Nome
    createdAt
    Tipo
    Date
    Descrizione

    Date and Time when the object was created.

  • Nome
    updatedAt
    Tipo
    Date
    Descrizione

    Date and Time when the object was updated.

  • Nome
    project
    Tipo
    Project
    Descrizione

    Relation to Project Resource in which this object belongs

  • Nome
    projectId
    Tipo
    Object ID Obbligatorio
    Descrizione

    ID of your OneUptime Project in which this object belongs

  • Nome
    apiKey
    Tipo
    API Key
    Descrizione

    The API key given the role.

  • Nome
    apiKeyId
    Tipo
    Object ID Obbligatorio
    Descrizione

    ID of the API key given the role.

  • Nome
    customRole
    Tipo
    Custom Role
    Descrizione

    The custom role given to the API key.

  • Nome
    customRoleId
    Tipo
    Object ID Obbligatorio
    Descrizione

    ID of the custom role given to the API key.

  • Nome
    createdByUser
    Tipo
    User
    Descrizione

    Relation to User who created this object (if this object was created by a User)

  • Nome
    createdByUserId
    Tipo
    Object ID
    Descrizione

    User ID who created this object (if this object was created by a User)

GET oppure POST
/api/api-key-custom-role/get-list

Elenco

Questo endpoint ti permette di recuperare un elenco paginato di tutti i tuoi API Key Custom Role. Per impostazione predefinita, vengono mostrati al massimo dieci API Key Custom Role per pagina.

Parametri di Query Opzionali

  • Limit
    limit
    Tipo
    number
    Descrizione
    Numero di oggetti da recuperare. Per impostazione predefinita 10, puoi aumentare questo conteggio fino a 100
  • Skip
    skip
    Tipo
    number
    Descrizione
    Numero di oggetti da saltare. Questo può essere utile nella paginazione

Corpo della Richiesta Opzionale

  • Query
    query
    Tipo
    query
    Descrizione
    Se desideri filtrare su API Key Custom Role. Puoi specificare e includere una query qui. Per ulteriori informazioni, consulta la sezione sulla scrittura delle query qui.
  • Select
    select
    Tipo
    select
    Descrizione
    Per impostazione predefinita recupererai solo l'ID degli oggetti, per recuperare più campi devi selezionarli. Per ulteriori informazioni, controlla come selezionare qui.
  • Sort
    sort
    Tipo
    sort
    Descrizione
    Gli oggetti verranno ordinati in base alla data di creazione per impostazione predefinita. Puoi modificare l'ordine di ordinamento passando controlla come selezionare qui.

Richiesta List

POST
/api/api-key-custom-role/get-list?skip=0&limit=10
Intestazioni
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corpo
{
  "select": {
    "apiKeyId": true,
    "customRoleId": true,
    "projectId": true,
    "apiKey": true,
    "createdByUser": true
  },
  "query": {},
  "sort": {
    "createdAt": -1
  }
}

Risposta

{
    "count": 10,
    "limit": 10,
    "skip": 0,
    "data": [
        {
            "_id": "b3811cc9-c760-4ab6-892b-aecc3bc950b4",
            "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
            "apiKey": "Production API Key",
            "createdByUser": "admin@company.com"
        },
        {
            "_id": "a15c2158-2fd5-4a86-b469-c7ec67abb006",
            "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
            "apiKey": "Production API Key",
            "createdByUser": "admin@company.com"
        },
        {
            "_id": "dc98c708-4f26-418c-ba75-7ed38cd37461",
            "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
            "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
            "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
            "apiKey": "Production API Key",
            "createdByUser": "admin@company.com"
        }
    ]
}
GET oppure POST
/api/api-key-custom-role/:id/get-item

Ottieni elemento per ID

Questo endpoint ti permette di recuperare API Key Custom Role per ID.

Parametri di Query Obbligatori

  • ID
    id
    Tipo
    text
    Descrizione
    ID dell'Oggetto

Corpo della Richiesta Opzionale

  • Select
    select
    Tipo
    select
    Descrizione
    Per impostazione predefinita recupererai solo l'ID degli oggetti, per recuperare più campi devi selezionarli. Per ulteriori informazioni, controlla come selezionare qui.

Richiesta Get Item

POST
/api/api-key-custom-role/:id/get-item
Intestazioni
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corpo
{
  "select": {
    "apiKeyId": true,
    "customRoleId": true,
    "projectId": true,
    "apiKey": true,
    "createdByUser": true
  }
}

Risposta

{
    "_id": "b3811cc9-c760-4ab6-892b-aecc3bc950b4",
    "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
    "apiKey": "Production API Key",
    "createdByUser": "admin@company.com"
}
POST
/api/api-key-custom-role/count

Conteggio

Questo endpoint ti permette di recuperare il conteggio di tutti i tuoi API Key Custom Role.

Corpo della Richiesta Opzionale

Richiesta Count

POST
/api/api-key-custom-role/count
Intestazioni
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corpo
{
  "query": {}
}

Risposta

{
    "count": 107
}
POST
/api/api-key-custom-role

Crea API Key Custom Role

Questo endpoint ti permette di creare un nuovo oggetto.

Corpo della Richiesta

  • Data
    data
    Tipo
    JSON
    Descrizione
    Oggetto da creare come JSON

Richiesta Create

POST
/api/api-key-custom-role
Intestazioni
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corpo
{
  "data": {
    "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
    "apiKey": "Production API Key",
    "customRole": "Incident Responder"
  }
}

Risposta

{
    "_id": "b3811cc9-c760-4ab6-892b-aecc3bc950b4",
    "apiKeyId": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "customRoleId": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "projectId": "a3f9c8e2-d4b6-4a7c-9e5f-1a2b3c4d5e6f",
    "apiKey": "Production API Key",
    "createdByUser": "admin@company.com"
}
PUT
/api/api-key-custom-role/:id

Aggiorna per ID

Questo endpoint ti permette di aggiornare un oggetto tramite il suo ID.

Corpo della Richiesta

  • Data
    data
    Tipo
    JSON
    Descrizione
    Oggetto da aggiornare come JSON

Metodi Alternativi

Per i client che non supportano le richieste PUT, puoi utilizzare POST o GET con le stesse intestazioni e corpo della richiesta:

POST /api/api-key-custom-role/:id/update-item

Richiesta Update

PUT
/api/api-key-custom-role/:id
Intestazioni
Content-Type: application/json
ApiKey: YOUR_API_KEY
Corpo
{
  "data": {}
}

Risposta

{}
DELETE
/api/api-key-custom-role/:id

Elimina per ID

Questo endpoint ti permette di eliminare un oggetto tramite il suo ID.

Metodi Alternativi

Per i client che non supportano le richieste DELETE, puoi utilizzare POST o GET con le stesse intestazioni e corpo della richiesta:

POST /api/api-key-custom-role/:id/delete-item

Richiesta Delete

DELETE
/api/api-key-custom-role/:id
Intestazioni
Content-Type: application/json
ApiKey: YOUR_API_KEY

Risposta

{}

Autorizzazioni

Il tuo token API necessita di autorizzazioni per creare, aggiornare, leggere o eliminare questa risorsa. Se non disponi delle autorizzazioni per effettuare una richiesta, verrà restituito uno stato 4xx come risposta.

Autorizzazioni di Lettura

Richiesto per leggere API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • ReadProjectApiKey
    Read API Key
    This permission can read api keys of this project.

Autorizzazioni di Creazione

Richiesto per creare API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • EditProjectApiKeyPermissions
    Edit API Key Permissions
    This permission can edit api key permissions of this project.

Autorizzazioni di Aggiornamento

Richiesto per aggiornare API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • EditProjectApiKeyPermissions
    Edit API Key Permissions
    This permission can edit api key permissions of this project.

Autorizzazioni di Eliminazione

Richiesto per eliminare API Key Custom Role

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • DeleteProjectApiKey
    Delete API Key
    This permission can delete api keys of this project.
  • EditProjectApiKeyPermissions
    Edit API Key Permissions
    This permission can edit api key permissions of this project.