Slutpunkt för appkonfigurationer
/app_configurations
börjar fungera när funktioner läggs till, tas bort och omarbetas.Appkonfigurationer tillåter att autentiseringsuppgifter lagras och hämtas för senare bruk. Med slutpunkten /app_configurations
i Reaktors API kan du programmässigt hantera appkonfigurationer i ditt upplevelseprogram.
Komma igång
Slutpunkten som används i den här guiden ingår i Reaktors-API. Innan du fortsätter bör du läsa kom igång-guiden för att få viktig information om hur du autentiserar dig för API:t.
Hämta en lista med appkonfigurationer list
API-format
GET /companies/{COMPANY_ID}/app_configurations
COMPANY_ID
id
för det företag som äger appkonfigurationerna.app_id
created_at
key_type
messaging_service
name
platform
updated_at
Begäran
curl -X GET \
https://reactor.adobe.io/companies/COdb0cd64ad4524440be94b8496416ec7d/app_configurations \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H "Content-Type: application/vnd.api+json" \
-H 'Accept: application/vnd.api+json;revision=1'
Svar
Ett lyckat svar returnerar en lista med appkonfigurationer.
{
"data": [
{
"id": "AC40c339ab80d24c958b90d67b698602eb",
"type": "app_configurations",
"attributes": {
"created_at": "2020-12-14T17:31:10.626Z",
"updated_at": "2020-12-14T17:31:10.626Z",
"app_id": "com.adobe.test_app",
"name": "Kessel Apns App",
"platform": "mobile",
"messaging_service": "apns",
"key_type": "p8_file"
},
"relationships": {
"company": {
"links": {
"related": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb/company"
},
"data": {
"id": "CO2bf094214ffd4785bb4bcf88c952a7c1",
"type": "companies"
}
}
},
"links": {
"company": "https://reactor.adobe.io/companies/CO2bf094214ffd4785bb4bcf88c952a7c1",
"self": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb"
}
}
],
"meta": {
"pagination": {
"current_page": 1,
"next_page": null,
"prev_page": null,
"total_pages": 1,
"total_count": 1
}
}
}
Söka efter en appkonfiguration lookup
Du kan söka efter en appkonfiguration genom att ange dess ID i sökvägen till en GET-begäran.
API-format
GET /app_configurations/{APP_CONFIGURATION_ID}
APP_CONFIGURATION_ID
id
för appkonfigurationen som du vill söka efter.Begäran
curl -X GET \
https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H "Content-Type: application/vnd.api+json" \
-H 'Accept: application/vnd.api+json;revision=1'
Svar
Ett lyckat svar returnerar information om appkonfigurationen.
{
"data": {
"id": "AC40c339ab80d24c958b90d67b698602eb",
"type": "app_configurations",
"attributes": {
"created_at": "2020-12-14T17:31:10.626Z",
"updated_at": "2020-12-14T17:31:10.626Z",
"app_id": "com.adobe.test_app",
"name": "Kessel Apns App",
"platform": "mobile",
"messaging_service": "apns",
"key_type": "p8_file"
},
"relationships": {
"company": {
"links": {
"related": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb/company"
},
"data": {
"id": "CO2bf094214ffd4785bb4bcf88c952a7c1",
"type": "companies"
}
}
},
"links": {
"company": "https://reactor.adobe.io/companies/CO2bf094214ffd4785bb4bcf88c952a7c1",
"self": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb"
}
}
}
Skapa en appkonfiguration create
Du kan skapa en ny programkonfiguration genom att göra en POST-förfrågan.
API-format
POST /companies/{COMPANY_ID}/app_configurations
COMPANY_ID
id
för det företag som du definierar appkonfigurationen under.Begäran
curl -X POST \
https://reactor.adobe.io/companies \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/vnd.api+json;revision=1' \
-d '{
"data": {
"attributes": {
"name": "Kessel Apns App",
"app_id": "com.adobe.test_app",
"platform": "mobile",
"messaging_service": "apns",
"key_type": "p8_file",
"push_credential": {
"bundleId": "com.adobe.test_app",
"keyId": "{KEY_ID}",
"p8": "{SECRET}",
"teamId": "{TEAM_ID}"
}
},
"type": "app_configurations"
}
}'
platform
messaging_service
key_type
push_credential
. När protokoll utvecklas för meddelandetjänster skapas nya key_type
-värden som stöder de uppdaterade protokollen.push_credential
Svar
Ett lyckat svar returnerar information om den nya appkonfigurationen.
{
"data": {
"id": "AC40c339ab80d24c958b90d67b698602eb",
"type": "app_configurations",
"attributes": {
"created_at": "2020-12-14T17:31:10.626Z",
"updated_at": "2020-12-14T17:31:10.626Z",
"app_id": "com.adobe.test_app",
"name": "Kessel Apns App",
"platform": "mobile",
"messaging_service": "apns",
"key_type": "p8_file"
},
"relationships": {
"company": {
"links": {
"related": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb/company"
},
"data": {
"id": "CO2bf094214ffd4785bb4bcf88c952a7c1",
"type": "companies"
}
}
},
"links": {
"company": "https://reactor.adobe.io/companies/CO2bf094214ffd4785bb4bcf88c952a7c1",
"self": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb"
}
}
}
Uppdatera en appkonfiguration
Du kan uppdatera en programkonfiguration genom att ta med dess ID i sökvägen för en PATCH-begäran.
API-format
PATCH /app_configurations/{APP_CONFIGURATION_ID}
APP_CONFIGURATION_ID
id
för appkonfigurationen som du vill uppdatera.Begäran
Följande begäran uppdaterar app_id
för en befintlig programkonfiguration.
curl -X PATCH \
https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/vnd.api+json;revision=1' \
-d '{
"data": {
"attributes": {
"app_id": "com.adobe.test_app_2"
},
"id": "AC40c339ab80d24c958b90d67b698602eb",
"type": "app_configurations"
}
}'
attributes
Ett objekt vars egenskaper representerar attributen som ska uppdateras för appkonfigurationen. Varje nyckel representerar det specifika programkonfigurationsattribut som ska uppdateras, tillsammans med motsvarande värde som det ska uppdateras till.
Följande attribut kan uppdateras för appkonfigurationer:
app_id
key_type
messaging_service
name
platform
push_credential
id
id
för appkonfigurationen som du vill uppdatera. Det här bör matcha det {APP_CONFIGURATION_ID}
-värde som anges i sökvägen till begäran.type
app_configurations
.Svar
Ett lyckat svar returnerar information om den uppdaterade programkonfigurationen.
{
"data": {
"id": "AC40c339ab80d24c958b90d67b698602eb",
"type": "app_configurations",
"attributes": {
"created_at": "2020-12-14T17:31:10.626Z",
"updated_at": "2020-12-14T17:31:21.787Z",
"app_id": "com.adobe.test_app_2",
"name": "Kessel Apns App",
"platform": "mobile",
"messaging_service": "apns",
"key_type": "p8_file"
},
"relationships": {
"company": {
"links": {
"related": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb/company"
},
"data": {
"id": "CO2bf094214ffd4785bb4bcf88c952a7c1",
"type": "companies"
}
}
},
"links": {
"company": "https://reactor.adobe.io/companies/CO2bf094214ffd4785bb4bcf88c952a7c1",
"self": "https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb"
}
}
}
Ta bort en appkonfiguration
Du kan ta bort en programkonfiguration genom att ta med dess ID i sökvägen för en DELETE-begäran.
API-format
DELETE /app_configurations/{APP_CONFIGURATION_ID}
APP_CONFIGURATION_ID
id
för appkonfigurationen som du vill ta bort.Begäran
curl -X DELETE \
https://reactor.adobe.io/app_configurations/AC40c339ab80d24c958b90d67b698602eb \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H "Content-Type: application/vnd.api+json" \
-H 'Accept: application/vnd.api+json;revision=1'
Svar
Ett lyckat svar returnerar HTTP-status 204 (inget innehåll) utan svarstext, vilket anger att appkonfigurationen har tagits bort.