Authenticate your requests to the Middesk API using API keys. Middesk provisions two keys when your account is created: one for sandbox and one for production.
You can access your API keys in the Middesk Dashboard, under Settings > Developer > Credentials.
You can also create new API keys on that page.
API authentication is generally performed using HTTP Basic Auth. Provide the API key as the username value.
You can also use Bearer Auth. Pass a header value of Authorization: Bearer mk_live_YOUR_API_KEY.
Neither approach requires a password, but all API requests should be made over HTTPS.
To support your development cycles, the API has two environments (or modes):
The two provisioned keys in your account match these two environments;
Test API key (prefixed mk_test) for sandbox mode, for use with https://api-sandbox.middesk.com/v1/ requestsLive API key (prefixed mk_live) for production, for use with https://api.middesk.com/v1/ requestsThe API key type and URL must match. You cannot use a production key with a sandbox URL or the other way around.