Unable to use Airship Snippets using RESTful API

Hi Team,

I have tried to use Airship Snippets for Sending Push Notification. but it does not seems to be work.
Request you to kindly provide your support.

Here is the curl code snippet for the same:

curl --location --request POST 'https://go.urbanairship.com/api/push' \
--header 'Authorization: Basic ***********************VrQ3BjRGNTY3ZSQTpLa*******************' \
--header 'Accept: application/vnd.urbanairship+json; version=3;' \
--header 'Content-Type: application/json' \
--data-raw '{
"audience": "all",
"device_types": [
"ios"
],
"notification": {
"alert": "{{>package_prefix}} Nike Shoes {{>delivered_suffix}} 25th May 2021"
},
"snippet_references": {
"snippets": [
{
"name": "package_prefix"
},
{
"name": "delivered_suffix"
}
]
}
}'

Highly appreciate your needful support.
Let me know, in case, you have any query.

Thanks

Didn't find what you were looking for?

New post

Comments

1 comment

  • Vikash,

    Looks like our docs were missing a vital piece of information, you need to add an option for personalization to be true.

    The other gotcha is there needs to be a space in between the {{> }} and snippet id. Correct: {{> delivered_suffix }} incorrect: {{>delivered_suffix}}

    Here is an updated payload for you that should work.

    {
    "audience": "all",
    "device_types": [
    "ios"
    ],
    "notification": {
    "alert": "{{> package_prefix }} Nike Shoes {{> delivered_suffix }} 25th May 2021"
    },
    "options": {
    "personalization": true
    }
    "snippet_references": {
    "snippets": [
    {
    "name": "package_prefix"
    },
    {
    "name": "delivered_suffix"
    }
    ]
    }
    }

    Thank you,

    Eric L.
    Technical Support Engineer
    Airship Group | Apptimize | Portland

    0

Please sign in to leave a comment.