I am trying to send a push to a specific named user.  I am getting a 400 error with message "empty selector".

 

Here is request:

{ "notification": { "alert": "View your quotation and accept the prices or request a new price.", "ios": { "title":"Your Quote is Ready", "extra":{ "quoteId":"22660" } }, "android":{ "title":"Your Quote is Ready", "extra":{ "quoteId":"22660" } } }, "audience":{ "named_user_id":"test" }, "device_types":"all"}

I simplified it to this for testing purposes (and got the same response):
{ "notification":{ "alert": "View your quotation and accept the prices or request a new price."}, "audience":{ "named_user_id":"test" }, "device_types":"all" }

 

Here is response:

{"ok":false,"error":"Could not parse request body.","error_code":40214,"details":{"error":"Empty selector."},"operation_id":"5c3361a8-eed6-4b2f-a255-cf6a64522347"}

Didn't find what you were looking for?

New post

Comments

3 comments

  • Hi Jeff,

    You will want to format your payload like this:

    {
      "notification": {
        "alert": "View your quotation and accept the prices or request a new price."
      },
      "audience": {
        "named_user": "test"
      },
      "device_types": [
        "ios",
        "android"
      ]
    }

    The audience selector for Named Users is named_user, not named_user_id, which is why it thought the audience selector was empty. You will also need to explicitly set the device_types because Named Users are not supported on every platform.

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

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

    0
  • Thanks.  That worked.

    0
  • Hi Sean  ,

                                                                                                                                                                                                                                                                 I want to prompt the customer with share and Deep link actions by interacting with buttons. He can choose one button from them. How can i do this?

     

    0

Please sign in to leave a comment.