Getting started
A typical preprocessing workflow involves:
- Configure an application and obtain an access token.
- Upload the input dataset.
- Create a preprocessing request.
- Monitor the job status.
- Retrieve the result.
Authentication
Parallel Model uses the OAuth 2.0 client credentials flow for application access. Register an application for your model, then exchange its client ID and client secret for a bearer access token.
Use the application portal, authentication API, and model API for the same region. The examples below use the uk1 region.
1. Create or select a model
- Sign in to your region's Parallel Model application. For
uk1, open app.uk1.parallelmodel.io. - On Manage Models, select Create Model and complete the model setup. If you already have a model, use that model.
- Open the model's Settings.
- Note the Model ID for API operations that require it.
- Find the Applications section, which lists applications registered to access this model.
2. Create an application and select scopes
If you do not have an application for the model:
- In Applications, select Add application.
- Enter an Application name.
- Select the scopes required by your integration.
- Select Create application.
- Copy the Client ID and Client secret, and store them securely.
Important
The client secret is displayed only when it is created or regenerated. Copy it before leaving the page. Keep it in a server-side secret store or environment variable, and exclude it from source control, public documentation, and browser-delivered code.
For blob operations and service health checks, the available scopes include:
| Scope | Permission |
|---|---|
shared.blob.delete |
Delete blobs. |
shared.blob.download |
Download blobs. |
shared.blob.read |
Read blobs. |
shared.blob.upload |
Upload blobs. |
shared.blob.write |
Write blobs. |
shared.health.read |
Read service health. |
For the preprocessing workflow, also select the following scopes as required by the endpoints you use:
| Scope | Permission |
|---|---|
ml.preprocessing.execute |
Execute preprocessing. |
ml.preprocessing.read |
Read preprocessing results. |
Request only the permissions your integration needs. Every scope in a token request must be assigned to the application.
3. Use an existing application or regenerate its secret
If an application already exists, use its Client ID and the client secret you previously saved. You do not need to regenerate the secret for each token request.
If the secret is unavailable or needs to be replaced:
- Open the model's Settings → Applications.
- Select Regenerate secret for the application.
- Select the checkbox confirming that the current client secret will be replaced.
- Select Regenerate secret.
- Copy and securely save the new secret before leaving the page.
- Update every service that uses the application credentials, then select Done.
Warning
Regenerating a secret prevents the previous secret from being used for new token requests. Existing access tokens may remain valid until they expire. Do not refresh or resubmit the secret confirmation page, as this may generate another secret.
4. Request an access token
Send a POST request to your region's authentication API. For uk1, use:
https://spmrgwebaswa1-g7apejczachgczhw.ukwest-01.azurewebsites.net/api/authorization/exchange
Set the request content type to application/x-www-form-urlencoded and supply these form fields:
| Field | Value |
|---|---|
grant_type |
client_credentials |
client_id |
Your application's client ID. |
client_secret |
Your application's current client secret. |
scope |
A space-separated list of scopes assigned to the application. |
The following scope value requests the blob and health permissions from the example application:
shared.blob.delete shared.blob.download shared.blob.read shared.blob.upload shared.blob.write shared.health.read
To use preprocessing endpoints, assign the required preprocessing scopes to the application and include them in the scope value as well:
ml.preprocessing.execute ml.preprocessing.read
Postman
- Create a request using the POST method and the authentication URL above.
- Open Body and select x-www-form-urlencoded.
- Add
grant_type,client_id,client_secret, andscopeusing the values described above. You can store the credentials as{{client_id}}and{{client_secret}}variables. - Enter all requested scopes in one
scopefield, separated by spaces. - Send the request. Postman sets the form content type automatically.
cURL
Set PARALLELMODEL_CLIENT_ID and PARALLELMODEL_CLIENT_SECRET in your environment before running this example in Bash:
curl --request POST \
'https://spmrgwebaswa1-g7apejczachgczhw.ukwest-01.azurewebsites.net/api/authorization/exchange' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode "client_id=${PARALLELMODEL_CLIENT_ID}" \
--data-urlencode "client_secret=${PARALLELMODEL_CLIENT_SECRET}" \
--data-urlencode 'scope=shared.blob.delete shared.blob.download shared.blob.read shared.blob.upload shared.blob.write shared.health.read'
This example requests blob and health permissions. Add the preprocessing scopes to the final argument when using preprocessing endpoints, after assigning those scopes to the application.
Response
A successful request returns a JSON object:
{
"access_token": "<access-token>",
"token_type": "Bearer",
"expires_in": 3599
}
| Field | Description |
|---|---|
access_token |
The token to send with subsequent API requests. |
token_type |
The authorization scheme. Use Bearer. |
expires_in |
The token lifetime in seconds. In this example, the token is valid for approximately one hour. |
5. Authenticate API requests
Include the access token in the Authorization header when calling your region's model API:
Authorization: Bearer <access-token>
In Postman, open the API request's Authorization tab, select Bearer Token, and paste the access_token value into the Token field.
Use the access token for API calls; use the client ID and client secret to request tokens. Reuse a valid token until it approaches expiry, then request a new token using the same client credentials flow. Use the returned expires_in value to determine when to renew it.
You can now upload your dataset, submit a preprocessing request, monitor the job, and retrieve its result.
See the API reference for endpoint parameters, required scopes, and response definitions.