Ir para o conteúdo
Entrar
Referência da API
Recurso

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.

O Modelo API Key Custom Role

Propriedades

  • Nome
    _id
    Tipo
    Object ID
    Descrição

    ID of this object

  • Nome
    createdAt
    Tipo
    Date
    Descrição

    Date and Time when the object was created.

  • Nome
    updatedAt
    Tipo
    Date
    Descrição

    Date and Time when the object was updated.

  • Nome
    project
    Tipo
    Project
    Descrição

    Relation to Project Resource in which this object belongs

  • Nome
    projectId
    Tipo
    Object ID Obrigatório
    Descrição

    ID of your OneUptime Project in which this object belongs

  • Nome
    apiKey
    Tipo
    API Key
    Descrição

    The API key given the role.

  • Nome
    apiKeyId
    Tipo
    Object ID Obrigatório
    Descrição

    ID of the API key given the role.

  • Nome
    customRole
    Tipo
    Custom Role
    Descrição

    The custom role given to the API key.

  • Nome
    customRoleId
    Tipo
    Object ID Obrigatório
    Descrição

    ID of the custom role given to the API key.

  • Nome
    createdByUser
    Tipo
    User
    Descrição

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

  • Nome
    createdByUserId
    Tipo
    Object ID
    Descrição

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

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

Listar

Este endpoint permite recuperar uma lista paginada de todos os seus API Key Custom Role. Por padrão, são exibidos no máximo dez API Key Custom Role por página.

Parâmetros de Consulta Opcionais

  • Limit
    limit
    Tipo
    number
    Descrição
    Número de objetos a buscar. Por padrão 10, você pode aumentar essa contagem até 100
  • Skip
    skip
    Tipo
    number
    Descrição
    Número de objetos a pular. Isso pode ser útil na paginação

Corpo de Requisição Opcional

  • Query
    query
    Tipo
    query
    Descrição
    Caso queira filtrar por API Key Custom Role. Você pode incluir uma consulta aqui. Para mais informações, consulte como escrever consultas aqui.
  • Select
    select
    Tipo
    select
    Descrição
    Por padrão, você recuperará apenas o ID dos objetos. Para recuperar mais campos, você precisa selecioná-los. Para mais informações, consulte como usar select aqui.
  • Sort
    sort
    Tipo
    sort
    Descrição
    Os objetos serão ordenados pela data de criação por padrão. Você pode alterar a ordem de classificação passando consulte como usar select aqui.

Requisição List

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

Resposta

{
    "count": 10,
    "limit": 10,
    "skip": 0,
    "data": [
        {
            "_id": "c5b680c0-1aa4-4b47-9e86-d1395180f04e",
            "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": "8db88ec8-6d63-41ed-a8c6-618d95146874",
            "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": "07a98f1c-7bc9-4a90-99a4-a13adcb3d87d",
            "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 ou POST
/api/api-key-custom-role/:id/get-item

Obter item por ID

Este endpoint permite recuperar API Key Custom Role por ID.

Parâmetros de Consulta Obrigatórios

  • ID
    id
    Tipo
    text
    Descrição
    ID do Objeto

Corpo de Requisição Opcional

  • Select
    select
    Tipo
    select
    Descrição
    Por padrão, você recuperará apenas o ID dos objetos. Para recuperar mais campos, você precisa selecioná-los. Para mais informações, consulte como usar select aqui.

Requisição Get Item

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

Resposta

{
    "_id": "c5b680c0-1aa4-4b47-9e86-d1395180f04e",
    "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

Contagem

Este endpoint permite recuperar a contagem de todos os seus API Key Custom Role.

Corpo de Requisição Opcional

Requisição Count

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

Resposta

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

Criar API Key Custom Role

Este endpoint permite criar um novo objeto.

Corpo da Requisição

  • Data
    data
    Tipo
    JSON
    Descrição
    Objeto a ser criado em formato JSON

Requisição Create

POST
/api/api-key-custom-role
Cabeçalhos
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"
  }
}

Resposta

{
    "_id": "c5b680c0-1aa4-4b47-9e86-d1395180f04e",
    "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

Atualizar por ID

Este endpoint permite atualizar um objeto pelo seu ID.

Corpo da Requisição

  • Data
    data
    Tipo
    JSON
    Descrição
    Objeto a ser atualizado em formato JSON

Métodos Alternativos

Para clientes que não suportam requisições PUT, você pode usar POST ou GET com os mesmos cabeçalhos e corpo da requisição:

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

Requisição Update

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

Resposta

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

Excluir por ID

Este endpoint permite excluir um objeto pelo seu ID.

Métodos Alternativos

Para clientes que não suportam requisições DELETE, você pode usar POST ou GET com os mesmos cabeçalhos e corpo da requisição:

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

Requisição Delete

DELETE
/api/api-key-custom-role/:id
Cabeçalhos
Content-Type: application/json
ApiKey: YOUR_API_KEY

Resposta

{}

Permissões

Seu Token de API precisa de permissões para criar, atualizar, ler ou excluir este recurso. Se você não tiver permissões para realizar uma requisição, um status 4xx será enviado como resposta.

Permissões de Leitura

Necessárias para ler 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.

Permissões de Criação

Necessárias para criar 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.

Permissões de Atualização

Necessárias para atualizar 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.

Permissões de Exclusão

Necessárias para excluir 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.