Create OAuth Credential
import requests
url = "https://api.parallel.ai/account/service/v1/apps/{app_id}/oauth-credentials"
payload = {
"client_id": "<string>",
"scopes": ["*"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_id: '<string>', scopes: ['*']})
};
fetch('https://api.parallel.ai/account/service/v1/apps/{app_id}/oauth-credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.parallel.ai/account/service/v1/apps/{app_id}/oauth-credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"scopes": [
"*"
]
}
'{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_id": "<string>",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_name": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_service_scoped": true,
"audience": "<string>",
"scopes": [
"<string>"
],
"token_endpoint": "<string>",
"refresh_token_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Keys
Create OAuth Credential
Create a refresh token for the product API in an app. Exchange it at token_endpoint for access tokens. The refresh token is returned once
POST
/
service
/
v1
/
apps
/
{app_id}
/
oauth-credentials
Create OAuth Credential
import requests
url = "https://api.parallel.ai/account/service/v1/apps/{app_id}/oauth-credentials"
payload = {
"client_id": "<string>",
"scopes": ["*"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_id: '<string>', scopes: ['*']})
};
fetch('https://api.parallel.ai/account/service/v1/apps/{app_id}/oauth-credentials', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.parallel.ai/account/service/v1/apps/{app_id}/oauth-credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"scopes": [
"*"
]
}
'{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_id": "<string>",
"app_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_name": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_service_scoped": true,
"audience": "<string>",
"scopes": [
"<string>"
],
"token_endpoint": "<string>",
"refresh_token_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Send Authorization: Bearer <access_token>. This must be an account API access token minted via a supported Parallel OAuth grant, not a standard API key. See the account API docs.
Body
application/json
Request to create a shapi refresh-token credential in an app.
Product API origin the credential is for. Only the GCP and AWS origins of this deployment are accepted. An org on an AWS Marketplace listing always gets the listing's origin
Available options:
https://api.parallel.ai, https://api.scl124ai.com, https://api-aws.parallel.ai, https://api-aws.dev.parallel.ai Response
Successful Response
A new shapi refresh-token credential. The refresh token is shown once.