The key 'expiry' is not allowed in this context

HI Team,

"Expiry" key not working for android Json. I am using below json for api calling :

URL : https://go.urbanairship.com/api/push

JSON for POST Request :

{
"audience":
{
"android_channel":["9c36e8c7-5a73-47c0-9716-99fd3d4197d0"]

},
"notification":
{
"android":
{
"extra":
{
"screenName": "Test",
"projectName":"Test-Project"

},
"alert":"Updated : TestActivity",
"title":"Milestone",
"sound":"true",
"expiry":"2018-03-15T20:15:30"
}
},
"device_types":"all"

}

 

Response : Please see the below error response .

{
"ok": false,
"error": "Could not parse request body.",
"error_code": 40000,
"details": {
"error": "The key 'expiry' is not allowed in this context",
"path": "notification.android.expiry",
"location": {
"line": 21,
"column": 16
}
},
"operation_id": "39adb731-aa1d-4e18-ac4c-1da617a0c58a"
}

 

Didn't find what you were looking for?

New post

Comments

1 comment

  • Hi Om,

    This is Sean with Urban Airship Technical Support.

    The expiry key needs to be included as part of the 'options' object in the payload.

    Please let me know if you have any other questions or concerns.

    Thank you,
    Sean Conlin
    Urban Airship Technical Support
    Portland, Oregon

     

    0

Please sign in to leave a comment.