Authentication
The 3Play Media API uses API keys to authenticate requests. You can manage your Admin and Project API keys on the API Access Management page. API keys have one of the following access levels:
- Admin: Manage other API keys, users, and projects.
- Project: Manage files, transcripts, audio descriptions, and live ASRs. Place orders.
- Observer: Read-only access to files, transcripts, audio descriptions, etc., including IDs and metadata.
Once you have an API key, you can test your access with Validate API Key, which confirms the key is valid and returns the account and project it belongs to.
Signed Authentication
For an added layer of security, signed authentication adds an expiring signature to each request. The signature is generated with an API secret key that is never exposed unless you request it. To use signed authentication, file a support ticket. Support has to turn it on for your account.
Once your account is set up to require signed requests, all standard workflow and admin requests from any API key in your account must include signature and signature_expires parameters.
signature_expires: Time since epoch, in seconds, after which the signature is considered invalid. This can be any value of your choosing.
signature: A SHA-256 hash computed using the method outlined below.
To compute your request signature:
- Join the following strings, in this order, with the
|character:- Request path (starting from
/v3) - Request method, in all caps
- Request query string with parameters alphabetized, excluding
signaturebut includingsignature_expires
- Request path (starting from
- Compute the SHA-256 hash of that string and encode the result as a Base64 string (RFC 4648, without line feeds). The result is your request signature.
- URL-encode the signature in your request if you are using a low-level tool such as curl.
As an example, let's generate a signature for a request to update a media file. We will make a PATCH request to https://api.3playmedia.com/v3/files/100 with the parameters name, api_key, signature, and signature_expires. Let's use the following mock values:
name=fooapi_key=123abcsignature_expires=1445471340
Our signature payload will be /v3/files/100|PATCH|api_key=123abc&name=foo&signature_expires=1445471340 (remember, parameters must be alphabetized). This gives us a Base64-encoded SHA-256 hash value of iLwRQXzXq69A7Uxq965bYZi/StZDGr7+SFU3aj4l8pM= (no line feed).
When used in curl (where we have to remember to URL-encode characters such as / and =), this looks like:
curl -X PATCH "https://api.3playmedia.com/v3/files/100?api_key=123abc&name=foo&signature_expires=1445471340&signature=iLwRQXzXq69A7Uxq965bYZi%2FStZDGr7%2BSFU3aj4l8pM%3D"
Updated 12 days ago
