403 Error while using API, but not from Dashboard

Hi,

I'm having an error while using the Urban Airship API for sending a push notification. Here is the payload I'm using:

{
"audience": "all",
"notification": {
"alert": "Foo title",
"actions": {
"open": {
"type": "deep_link",
"content": "foo://fooURL/fooParameter"
}
}
},
"message": {
"title": "Foo title",
"body": "Foo description"
},
"device_types": "all"
}

With this one I'm getting a 403 forbidden error (The specified appkey [XXXXXXX] is not entitled to use the Message Center). But from UrbanAirhsip dashboard, I'm able to submit the push notification. My guess is that I'm sending something incorrect or different than when using the dashboard (I'm just interested in using a title/description field).

Could you provide me some feedback for knowing where is the problem? Thanks in advance

Didn't find what you were looking for?

New post

Comments

2 comments

  • Hi Alejandro,

    You are receiving an error in your API request because you are attempting to send a Message Center message along with a push notification, which your account level does not have access to. If you would like to send just a push notification with a title and a description, the request will need to look something like this:


    {
      "audience": "all",
      "notification": {
        "actions":{
         "open":{
            "type":"deep_link",
            "content":"foo://fooURL/fooParameter"
          }
        },
        "ios": {
          "alert": "Hello iOS!",
          "title": "Insert title here",
          "subtitle": "Subtitle"
        },
        "android": {
          "alert": "Hello Android!",
          "title": "Insert title here!",
          "summary": "Summary"
        }
      },
      "device_types": ["ios", "android"]
    }

    I hope this helps. Please let me know if there are any additional details I can provide.

    0
  • Yes!! This works!

    Thank you!

    0

Please sign in to leave a comment.