Comment on page
Authenticating
Authenticate with API Key
Alphamoon Workspace API uses API keys to authenticate requests.
To authorize your API calls, you can choose between two methods: using the API key in the request header or using the API key in Basic Auth. Choose the method that best suits your requirements and follow the instructions below.
API key Basic Auth allows a user agent, such as a web browser, to provide credentials to the server in order to access protected resources.
Here's an example of Basic Authentication requests using the Alphamoon Workspace API key:
cURL
Python
curl -u "API_KEY" https://workspace.alphamoon.ai/api/v0.3/processes
import requests
GET_PROCESSES_URL = 'https://workspace.alphamoon.ai/api/v0.3/processes'
basic = requests.auth.HTTPBasicAuth('user', 'pass')
resp = requests.get(url=GET_PROCESSES_URL, auth=basic)
Note:
To include the API key in your API calls using Basic Auth, follow these steps:
- Set the
Authorization
header in your HTTP requests. - The header value should be in the format:
Basic BASE64_ENCODED_API_KEY
, whereBASE64_ENCODED_API_KEY
is the Base64 encoding of the stringAPI_KEY
. - Send your API request to the appropriate endpoint.
Take a look at the example:
cURL
Python
curl -H "Authorization: Basic API_KEY_BASE64_ENCODED" https://workspace.alphamoon.ai/api/v0.3/processes
import requests
import base64
GET_PROCESSES_URL = 'https://workspace.alphamoon.ai/api/v0.3/processes'
api_key = 'user:pass'.encode('ascii')
api_key_base64_encoded = base64.b64encode(api_key).decode('ascii')
headers={"Authorization": f"Basic {api_key_base64_encoded}"}
resp = requests.get(url=GET_PROCESSES_URL, headers=headers)
To encode the credentials, you can use a tool like base64 in Linux or macOS, or an online Base64 encoding tool.
Note:
Last modified 2mo ago