Authentication

computer

All HTTP requests made to the Coin Publishers API must be validated with an API key.

You can supply your API key in REST API calls in one of two ways:

1. Preferred method: Via a custom header named x-cp_api_key
2. Convenience method: Via a query string parameter named api_key

The following is an example of the preferred authentication method in which the API key is passed in the header:

curl
-H "x-cp_api_key: b54bcf4d-1bca-4e8e-9a24-221233d462c"
-H "Accept: application/json"
-d "activities=saving&coin=btc"
-G https://coinpublishers.com/api/v1/coins/earn/rates

Alternatively, the API key can be passed in the query fields using field name cp_api_key

curl
-H "Accept: application/json"
-d "api_key=b54bcf4d-1bca-4e8e-9a24-221233d462c&activities=saving&coin=btc"
-G https://coinpublishers.com/api/v1/coins/earn/rates