Setup

Authentication, Base URLs and Usage

Authentication

To interact with the Sarafa API, you will utilize API keys for authentication.

  • Format: Secret keys follow the UUID version 4 (Universally Unique Identifier) format.

    xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

    Example: a1b2c3d4-e5f6-4789-9012-34567890abcd

Base URL

All API requests to Sarafa should be directed to the following base URLs for the production environment:

  • https://api.sarafa.live/v2

  • https://api.sarafa.ss/v2

API Usage

You will need to include your API key in the header of every API request for authentication. The key should be passed in a header with the name api-key.

curl -X GET \
     https://api.sarafa.live/v2/wallets \
     -H 'api-key: your_secret_key_here'

All responses from the Sarafa API will be formatted in JSON.Example JSON Response (Success - HTTP 200 OK):

Error Handling The Sarafa API uses standard HTTP status codes to indicate the outcome of your requests.

200 OK: This status code indicates that your request was successful and you are properly authenticated with a valid API key. The response body will contain the requested data in JSON format (as shown in the example above).

401 Unauthorized: This status code indicates that your API key is invalid, missing, or has expired. Ensure you are including a valid API key in the api-key header of your request.When integrating with the Sarafa API, it’s crucial to handle these HTTP status codes appropriately to ensure your application functions correctly and provides informative feedback.

Always store your secret keys securely.

Last updated