The error "Please select at least one platform" from the /createMessage API means the request does not resolve to any platform to send to. This happens either because your application in the Pushwoosh Control Panel has no platform configured, or because the platforms array in the request contains no valid, configured platform.
-
Check the application configuration: in the Control Panel, verify that the platform you target is configured for the application (for example, iOS has a valid .p12 certificate or .p8 key, Android has an FCM service-account JSON uploaded).
-
Let Pushwoosh target all configured platforms: simply omit
platforms. The message is then sent to every platform enabled for the application.{ "request": { "application": "YOUR_APPLICATION_CODE", "auth": "YOUR_API_ACCESS_TOKEN", "notifications": [{ "send_date": "now", "content": "Your message content", "devices": ["DEVICE_HWID_1", "DEVICE_HWID_2"] }] } } -
Or specify platforms explicitly with the optional
platformsarray of platform codes:{ "request": { "application": "YOUR_APPLICATION_CODE", "auth": "YOUR_API_ACCESS_TOKEN", "notifications": [{ "send_date": "now", "content": "Your message content", "platforms": [1, 3] }] } }Current platform codes:
1iOS,3Android,7Mac OS X,8Windows,9Amazon,10Safari,11Chrome,12Firefox,17Huawei. See the Messages API reference for the full list. -
Platform-specific content keys such as
ios_badges,ios_soundorandroid_headeronly customize the payload for a platform — they do not select the platform. Useplatforms(or omit it) for targeting.
Finally, make sure the payload is well-formed JSON. JSON does not allow comments, so do not leave // notes inside a real request body.
Comments
0 comments
Please sign in to leave a comment.