Hi,
I am trying to create a content template in AJO using Postman API following this documentation. When I run the POST request in Postman, I get the following response -
The response suggests that the 'sandboxId' is missing as one of the header parameters. However, I wasn't able to find references on where I can retrieve the 'sandboxId' from, to be able to run this POST request successfully.
- Has anybody faced this issue previously?
- How were you able to retrieve the sandboxId to be able to run this request successfully?
- Any other changes that I should incorporate to the request based on the error response?
Thanks!
Shashank
解決済! 解決策の投稿を見る。
トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。
表示
返信
いいね!の合計
code below works for me
curl --location 'https://platform.adobe.io/ajo/content/templates' \
--header 'x-api-key: <string>' \
--header 'x-gw-ims-org-id: <string>' \
--header 'x-sandbox-name: <string>' \
--header 'Content-Type: application/vnd.adobe.ajo.template.v1+json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data '{
"name": "ar html test1",
"description": "jhgkjhk",
"templateType": "html",
"channels": [
"email"
],
"source": {
"origin": "ajo",
"metadata": {}
},
"template": {
"html": "<html>hello</html>",
"editorContext": {}
}
}'
AEP/AJO API calls use sandbox name not sandbox id. I will recommend to check instead header for application/content as 406 is more an API error related to the media you're loading.
Another way to debug is to use a get Template API to check if you are able to hit the endpoint.
Thanks,
David
Thanks, @DavidKangni ! I triggered a GET request and was successfully able to hit the endpoint. However, the error with the POST request persists.
Here is the cURL for the request I am triggering, if that provides more insight into the issue -
curl --location 'https://platform.adobe.io/ajo/content/templates' \
--header 'Authorization: Bearer {redacted}' \
--header 'x-api-key: {redacted}' \
--header 'x-gw-ims-org-id: {redacted}@AdobeOrg' \
--header 'x-sandbox-name: {redacted}' \
--header 'Content-Type: application/json' \
--data '{
"name":"ar html test1",
"description":"jhgkjhk",
"templateType":"html",
"channels":[
"email"
],
"source":{
"origin":"ajo",
"metadata": { }
},
"template":{
"html":"<html>hello</html>",
"editorContext":{ }
}
}'
If you have a working API for creating the content template, could you please share so I can give that a try as well?
Thanks,
Shashank
表示
返信
いいね!の合計
code below works for me
curl --location 'https://platform.adobe.io/ajo/content/templates' \
--header 'x-api-key: <string>' \
--header 'x-gw-ims-org-id: <string>' \
--header 'x-sandbox-name: <string>' \
--header 'Content-Type: application/vnd.adobe.ajo.template.v1+json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data '{
"name": "ar html test1",
"description": "jhgkjhk",
"templateType": "html",
"channels": [
"email"
],
"source": {
"origin": "ajo",
"metadata": {}
},
"template": {
"html": "<html>hello</html>",
"editorContext": {}
}
}'
Thank you, @DavidKangni! Able to create the template now.