Remote Platform

Authentication

Overview of the authentication process

Overview

The API requires authentication to ensure that only authorized users can access its resources. The authentication process involves obtaining an API key and using it in the request headers.

Terminology

API Key {apiKey}

  • API Key: A unique identifier used to authenticate requests to the API. It is a string that is passed in the request headers.

Project ID {projectId}

  • Project ID: A unique identifier for a project within the API. It is used to specify the context of the request.

The API key is associated with a specific project. When making requests, you need to specify the project ID in the request URL. The project ID is a unique identifier for your project within the API. An API key can be used for multiple projects, but each project will have its own unique project ID.

Authentication Process

  1. Obtain an API Key: To get an API key, you need to contact our support team to fetch it for you. The API key is a unique identifier that allows you to authenticate your requests.
    • Contact Support: Reach out to our support team via email or through the support portal to request your API key.
    • Provide Necessary Information: You may need to provide information about your account and the intended use of the API.
    • Receive Your API Key and Project ID: Once your request is approved, you will receive your API key and the associated project ID. Make sure to store this information securely, as it will be required for all API requests.
  2. Make API Requests: Use the API key in all your requests to authenticate and authorize access to the resources.
  3. Handle Authentication Errors: If the API key is missing or invalid, you will receive a 401 Unauthorized response. Ensure that your API key is correct and has the necessary permissions to access the requested resource. If you receive a 403 Forbidden response, it means that the API key does not have permission to access the requested resource or the project ID is incorrect.
  4. Regenerate API Key: If you suspect that your API key has been compromised, you can regenerate it from your application settings. Make sure to update your requests with the new API key.
  5. Rate Limiting: The API enforces rate limits based on the API key. If you exceed the rate limit, you will receive a 429 Too Many Requests response. Monitor your usage and adjust your requests accordingly.
  6. Best Practices:
    • Keep your API key secure and do not expose it in public repositories or client-side code.
    • Use environment variables to store your API key in development and production environments.
  7. Contact Support: If you encounter any issues with authentication or have questions about the API key, contact the support team for assistance.

Example Request

curl -X GET "https://staging.saharobotik.com/api/v2/client/{projectId}/delivery/targets" \
  -H "x-api-key: {apiKey}"
  -H "Content-Type: application/json"