No Message ID in API response

Answered

Comments

5 comments

  • Avatar
    Alexander Spotar

    Please refer to the recent post in our Blog:

    For load balancing purposes we do not store messages sent through API with the “devices” parameter that contains less than 10 devices in an array. Due to this, such messages will not be displayed in your Push History.

    However, as it’s necessary to see push reports during the testing phase, there’s a Debug Mode that you can use during your tests. Turning Debug Mode ON allows you to override this limit for 1 hour and save such pushes in the push history. Debug mode turns OFF automatically after 1 hour.

    The Debug Mode can be activated on the Pushes page:

    alt text

    Besides, as these messages are no longer saved, the response from the Pushwoosh API has changed as well. If the Debug Mode is turned OFF, and you send the /createMessage request that contains less than 10 device tokens to Pushwoosh API, the server will return an empty value for “Messages” value, and an empty key for Unknown Devices instead of the Message Code.

    For example, here’s the basic createMessage request with a list of less than 10 tokens in the “devices” parameter:

    {
       "request":{
          "application":"application_code",
          "auth":"api_access_key",
          "notifications":[
             {
                "send_date":"now",
                "content":"Hello world!",
                "devices":["device_token1","device_token_2","device_token_3"]
             }
          ]
       }
    }
    

    With the Debug Mode turned ON Pushwoosh API returns the following response:

    {
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "Messages": ["B036-16AC355D-7C36D4C7"],
        "UnknownDevices": {
            "B036-16AC355D-7C36D4C7": ["device_token1", "device_token_2", "device_token_3"]
        }
    }
    

    }

    If the Debug Mode is turned OFF, which is default, Pushwoosh API returns response as follows:

    {
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "Messages": [""],
        "UnknownDevices": {
            "": ["device_token1", "device_token_2", "device_token_3"]
        }
    }
    

    }

    IMPORTANT: If you schedule push you will receive its message code, so you can delete the message through API if needed.

  • Avatar
    derng

    This is really bad for all the apps using this on the market, especially how this was discovered and deployed live before other developers were made aware of these changes, and is certainly making me regret my newly purchased premium account.

    Is there absolutely no way that this can be reverted? Or is there a work around for producing personalised notifications?

  • Avatar
    Wyoung

    Wow I just read this after testing my new app for push notifications, and unless there is a way for the API to return the message id's for pushed messages for < 1 device token, then it's time once again to look for another push provider! I absolutely need the ability to push via the API to a single device token, and need to be able to store the message id for later purposes, specifically for cases where the message being sent is a future schedule push, and they want to delete it. I would have no way of being able to A) identify the scheduled push message, or B) delete it via the API. Big functionality gap! Any ideas or suggestions?!

  • Avatar
    Max Konev

    When message is scheduled to be delivered - you will receive message code. Only if the message is delivered "now" you won't receive message code.

  • Avatar
    Max Konev

    If you schedule message you will receive message code so you can delete the message. If you send the message straightaway you won't receive the message code as the message will be sent immediately.

Please sign in to leave a comment.