Authenticate API requests and securely open the editor for end users.
ASC Editor Plugin backend APIs use Application credentials and an Application-scoped access token.
Authentication summary
| Area | Authentication |
|---|---|
| Create Application token | Authorization: Basic <base64(clientId:clientSecret)> |
| Create one-time code | Authorization: Bearer <application_access_token> |
| Email Resource API | Authorization: Bearer <application_access_token> |
| AI Resource API | Authorization: Bearer <application_access_token> |
| Editor frontend URL | No Authorization header; use the one-time code and Email id. |
API credentials
Create Application credentials from:
Application -> Editor API -> Application KeysThe credential pair contains:
- Client ID
- Client Secret
Store both values on your backend. Never expose the Client Secret in browser code, mobile apps, logs, or public repositories.
Create an Application access token
Call POST /access/token from your backend using HTTP Basic Auth. The username is the Client ID and the password is the Client Secret.
The endpoint has no request body and does not create an End User.
curl -X POST 'https://api.aurorasendcloud.com/editor-plugin/access/token' \
-H 'Authorization: Basic ZGVtb19jbGllbnRfaWQ6ZGVtb19jbGllbnRfc2VjcmV0'The sample header contains the Base64-encoded value of:
demo_client_id:demo_client_secretResponse:
{
"access_token": "example_access_token",
"expires_in": 604800,
"token_type": "Bearer"
}The default lifetime is 604800 seconds (7 days). Keep the token on your backend and obtain a new one after it expires. Although the token uses JWT format, treat it as an opaque credential and do not depend on its internal claims.
Use the Application access token
Send the returned token as:
Authorization: Bearer <application_access_token>Use it for:
POST /access/codePOST /resource/emailGET /resource/emailGET /resource/email/{emailId}PUT /resource/email/{emailId}DELETE /resource/email/{emailId}POST /resource/email/{emailId}/copyGET /resource/ai/quotaGET /resource/ai/balancesGET /resource/ai/billsGET /resource/ai/usagePUT /resource/ai/end-user-quota-limit
Every Email Resource request must explicitly pass userId, even though the access token already identifies the Application. AI Resource API endpoints operate at the Application level; userId is an optional query filter on /resource/ai/usage and a required field in the request body of /resource/ai/end-user-quota-limit. The Application must have the AI capability enabled to access any /resource/ai endpoint.
Create a one-time editor code
Call POST /access/code with the Application access token and the End User ID from your own system. name, email, phone, and extra are optional.
curl -X POST 'https://api.aurorasendcloud.com/editor-plugin/access/code' \
-H 'Authorization: Bearer example_access_token' \
-H 'Content-Type: application/json' \
-d '{
"userId": "user_12345",
"name": "Jane Doe",
"email": "[email protected]",
"phone": "13800138000",
"extra": {
"variables": [
{
"category": "Customer Attributes",
"name": "Member Level",
"value": "member_level",
"preview": "Gold Member",
"description": "User current membership level"
}
]
}
}'userId is required. Non-blank name, email, and phone values update the stored End User profile. Omitting an optional field, or passing null or an empty string, preserves its existing value. A non-empty email must use a valid email format and must not exceed 200 characters; phone must not exceed 50 characters.
End User variables (extra.variables)
extra.variables dynamically injects custom End-User-level variables into the editor session when generating the one-time code, making placeholders available for template design.
| Field | Required | Constraints | Description |
|---|---|---|---|
category | No | ≤ 50 characters | Category or grouping name |
name | Yes | ≤ 50 characters | Friendly display name |
value | Yes | ≤ 100 characters | Actual inserted token/symbol (e.g. member_level) |
preview | No | ≤ 100 characters | Sample preview value |
description | No | ≤ 200 characters | Description or explanation |
| Total items | — | ≤ 100 items | Exceeding limits returns 400 invalidParameter |
Clearing Semantics: Ifextrais omitted orvariablesis passed as an empty array[], any previously saved variables for that user are cleared, preventing the editor from reading stale variables from prior sessions. Variables are cached for the session only, do not persist to the DB, and are read by the editor frontend during code exchange (code2auth).
Response:
{
"code": "example_code",
"expires_in": 300,
"userId": "user_12345"
}The code is single-use and expires after 5 minutes. Generate a new code every time the editor opens.
Open the editor
Return only the one-time code and public Email slug to the browser. Open the editor on the Application's active editor domain:
https://abc.editor.aurorasendcloud.com/thirdApp?code=example_code&id=b7e4a9c2d1f60835&lang=en_US| Parameter | Required | Description |
|---|---|---|
code | Yes | One-time code returned by POST /access/code. |
id | Yes | Public Email slug returned by an Email Resource API. |
lang | No | Editor language, such as en_US, zh_CN, zh_TW, th_TH, or ja_JP. |
/thirdApp is an editor frontend route, not a third-party backend API. If the Application uses a custom editor domain, replace only the domain.
Credential boundaries
| Credential | Purpose | Browser exposure |
|---|---|---|
| Client ID and Client Secret | Create the Application access token. | Never expose. |
| Application access token | Call Access and Email Resource APIs. | Never expose. |
| One-time editor code | Open one editor session. | May be passed to the browser. |
| Public Email slug | Select the Email opened by the editor. | May be passed to the browser. |
