/ API

Debug Mode for messages sent to a few devices through API

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:

Pushwoosh Debug Mode

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 returns a “CODE_NOT_AVAILABLE” value for “Messages”, 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": ["CODE_NOT_AVAILABLE"], "UnknownDevices": { "": ["device_token1", "device_token_2", "device_token_3"] } } }