API key Endpoint

Note

The examples below use API endpoints from the live COPO website.

To use the demo website instead, replace https://copo-project.org/api/ with https://demo.copo-project.org/api/ in the URLs.

Tip

  • To view details of the endpoint, click the api-key-collapsible-item-arrow Show endpoint details button.

  • Then, inside that section, click the api-key-collapsible-item-arrow Show API query parameters button to see input parameter details.


Obtain an API key for authentication

Show endpoint details
Show API query parameters

Note

This endpoint allows users to obtain an API key for authentication purposes. The API key is required for accessing certain API methods that require user authentication.

  • username (required): The username of the individual for whom the API key is being requested.

  • password (required): The password of the individual for whom the API key is being requested.


Usage

Please include at least the username and password parameter values in the API URL to obtain an API key for authentication. Replace <username> and <password> with the desired values.

https://copo-project.org/api/apiKey
$ curl -X POST "https://copo-project.org/api/apiKey" -H  "accept: application/json" -H  "Content-Type: application/x-www-form-urlencoded" -d "username=<username>&password=<password>"

Example

To create an API key for the user with username janedoe and password password123, use the following URL:

$ curl -X POST "https://copo-project.org/api/apiKey" -H  "accept: application/json" -H  "Content-Type: application/x-www-form-urlencoded" -d "username=janedoe&password=password123"

Note

  • To use the API token key, click the api-authorise-button button at the top right of the page.

  • Enter the token value as token <token> when prompted for it. Replace <token> with the actual token value obtained from the API response. Note the token text before the value.