API Key

YCloud APIs use API keys for authentication. An API key is a token that a client provides when making API calls. The key should be sent as a request header named X-API-Key:

GET /something HTTP/1.1
Host: api.ycloud.com
X-API-Key: YOUR_API_KEY

📘

How do I get my API Key?

Log in to YCloud Dashboard and you will find it on that page.

Test with cURL

cURL is a command-line tool and library for transferring data with URLs. Here is an example to retrieve your account balance of YCloud authenticated with an API key:

curl -X GET 'http://api.ycloud.com/v2/balance' \
-H 'X-API-Key: YOUR_API_KEY'

It returns a response with HTTP status 200 if succeeded. Here is an example of response body:

{
  "amount": 190.07658,
  "currency": "USD"
}

Otherwise, it returns a response with HTTP status 401 if the API key is invalid. Here is an example of response body:

{
  "error": {
    "status": 401,
    "code": "UNAUTHORIZED",
    "message": "INVALID_API_KEY"
  }
}