Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

The key 'expiry' is not allowed in this context

Om Kesarwani

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"
}

 

Please sign in to leave a comment.

0
Avatar

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

 

Sean Conlin 0 votes
Comment actions Permalink