Documentation
  • 👋Welcome to Documentation
  • 📖Glossary
  • ❓FAQs
  • General
    • Getting set up
      • Single-user organization
      • Multi-user organization
    • Supported Document Types
  • Platform Walkthrough
    • Dashboard
    • Queue
    • Configuration
    • Supervision
  • User guide How Tos
    • User Management
      • How to invite a new user to the platform?
      • How can I manage existing users?
    • Processes
      • How to create a supervised process or use the template?
      • How to create a custom process?
    • Supervision
      • How to add, assign, and remove annotations?
      • How to edit the value of the extraction?
      • How to open and edit a table mask?
      • How to open, edit, or remove the extracted table?
      • How to export your data via Supervision?
      • How to copy values and tables?
    • Upload
    • Converters
    • Data points definition
    • Data Export
    • Table Data Extraction
    • Enrichment
    • Generating new API key
  • Integrations
    • Zapier Integration
      • Quickstart
      • Alphamoon as a Trigger
      • Alphamoon as an Action
    • Google Sheets - Export
  • Features
    • Continuous Learning (Beta)
    • Document Splitting
  • API
    • Introduction
    • Quickstart
    • Organization API keys (Beta)
    • Process API keys (Beta)
    • Authenticating
    • Versioning
    • Get results
    • Get OCR results
    • Get processes
    • Get process types
    • Get collections
    • Metadata
      • Setting metadata value
    • Upload File
    • Export
    • Download original files
    • Delete collection
    • Reset process configuration
  • Resources
    • 💻Alphamoon Website
Powered by GitBook
On this page
  • Using Basic Auth
  • Using the API key in the request header
  1. API

Authenticating

Authenticate with API Key

PreviousProcess API keys (Beta)NextVersioning

Last updated 1 year ago

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.

Using Basic Auth

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 -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:

Replace API_KEY in the request above with the value of the field.

Using the API key in the request header

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, where BASE64_ENCODED_API_KEY is the Base64 encoding of the string API_KEY.

  • Send your API request to the appropriate endpoint.

Take a look at the example:

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:

See next:

Replace BASE64_ENCODED_API_KEY with the Base64-encoded value of the field.

Your new API key
Your new API key