Skip to main content

Api client ID

API client access key

Tip

Ensure you have completed the configuration steps Here


The client ID can be used to manage CORS and restrict access to the API

Get all client

Request

GET
http://localhost:5501/api/v1/client

Response

{
"status": "String",
"total":"Number",
"clients": "Array"
}

Response Validation

  1. status - response status
  1. total - total client IDs
  1. clients - Array containing all client IDs

Example

Response

{
"status": "success",
"total": 1,
"clients": [
{
"_id": "62d590d7f3c448893364a008",
"client_id": "VUBtyf_ygHvg9QcubzTai",
"client_url": [
"one.com"
],
"scope": [
"models"
],
"date": "2022-07-18T09:53:36.873Z",
"__v": 0
}
]
}

Add a new Client

Request body

{
"url": "Array"
}

Body Validation

  1. url - list of origins to use the client ID

Request

POST
http://localhost:5501/api/v1/client

Response

{
"status": "String",
"client_id": "String"
}

Response Validation

  1. status - request status
  1. client_id - Created client ID

Example

Body

{
"url":["one.com"]
}

Response

{
"status": "success",
"client_id": "VUBtyf_ygHvg9QcubzTai"
}

Update Client ID

Request body

{
"url":"Array"
}

Body Validation

  1. url - list of origins to use the client ID

Request

PATCH
http://localhost:5501/api/v1/client/<API_CLIENT_ID>

Response

{
"status": "String",
"message": "String"
}

Response Validation

  1. status - request status
  1. message - response message

Example

Body

{
"url":["two.com"]
}

Response

{
"status": "success",
"message": "Api client updated"
}

Delete Client

Request

DELETE
http://localhost:5501/api/v1/client/<API_CLIENT_ID>

Response