Create a partner OAuth application
curl --request POST \
--url https://api.swapnice.com/v1/apps \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-swapnice-admin-key: <api-key>' \
--data '
{
"name": "<string>",
"redirect_uris": [
"<string>"
],
"allowed_scopes": [
"<string>"
],
"scopes": [
"<string>"
],
"allowed_consent_purposes": [],
"webhook_default_url": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-swapnice-admin-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
redirect_uris: ['<string>'],
allowed_scopes: ['<string>'],
scopes: ['<string>'],
allowed_consent_purposes: [],
webhook_default_url: '<string>'
})
};
fetch('https://api.swapnice.com/v1/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/apps"
payload = {
"name": "<string>",
"redirect_uris": ["<string>"],
"allowed_scopes": ["<string>"],
"scopes": ["<string>"],
"allowed_consent_purposes": [],
"webhook_default_url": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-swapnice-admin-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"app_id": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"name": "<string>",
"redirect_uris": [
"<string>"
],
"scopes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Apps
Create a partner app
Register an OAuth application. Returns the client secret once.
POST
/
v1
/
apps
Create a partner OAuth application
curl --request POST \
--url https://api.swapnice.com/v1/apps \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-swapnice-admin-key: <api-key>' \
--data '
{
"name": "<string>",
"redirect_uris": [
"<string>"
],
"allowed_scopes": [
"<string>"
],
"scopes": [
"<string>"
],
"allowed_consent_purposes": [],
"webhook_default_url": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-swapnice-admin-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
redirect_uris: ['<string>'],
allowed_scopes: ['<string>'],
scopes: ['<string>'],
allowed_consent_purposes: [],
webhook_default_url: '<string>'
})
};
fetch('https://api.swapnice.com/v1/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/apps"
payload = {
"name": "<string>",
"redirect_uris": ["<string>"],
"allowed_scopes": ["<string>"],
"scopes": ["<string>"],
"allowed_consent_purposes": [],
"webhook_default_url": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-swapnice-admin-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"app_id": "<string>",
"client_id": "<string>",
"client_secret": "<string>",
"name": "<string>",
"redirect_uris": [
"<string>"
],
"scopes": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Register an OAuth application. Returns the client secret once.
Usually called by Swapnice during onboarding with an app registration key. Store
client_secret immediately.Authorizations
Administrative registration key for creating partner applications.
Headers
Required for mutating requests. Replays with the same key and payload hash return
the original logical result; replays with a different payload hash return 409.
Required string length:
16 - 255Optional caller-supplied correlation ID echoed in responses and errors.
Body
application/json
Minimum array length:
1Available options:
public, confidential Minimum array length:
1Backwards-compatible alias for allowed_scopes.
Minimum array length:
1Available options:
account_linking, personalization, analytics, support, event_enrichment, profile_resolution, measurement ⌘I