Authentication
Introduction
Access to the Crop.photo API is secured through authentication mechanisms designed to protect your data and ensure that only authorized users can make requests. This guide will walk you through the process of generating an API key, outline best practices for managing these keys, and demonstrate how to use them securely in your applications.
Generating your API key
To begin using the Crop.photo API, you'll need to generate an API key. This key serves as a unique identifier and token for authentication, enabling you to access API resources securely. Follow these steps to generate your key:
- Log in to your Crop.photo account and navigate to the Developer Settings.
- Click on the "Generate new API key" button.
- Provide a meaningful name for your API key. You can use this to distinguish between API keys for different purposes, for example, one API key can be used in the development environment for testing and another for production. Therefore, label them purposefully.
- Copy the generated API key and keep it safe. Generated API keys are shown once, and you won't be able to view them again.
- See the images below for reference.
How to use your API key
- Append your API key to the
Authorization
header for each HTTP request you make. - Position your API key right after the term
Bearer
within theAuthorization
header. Ensure a single space separates 'Bearer' and your API key. - If your API key is
api_xxxx1234
, format it as:Authorization: Bearer api_xxxx1234
. - Safeguard your API key, treating it as sensitive information to avoid unauthorized access.
Last modified: 7 months ago