I have used the updated Journey builder SDK for Android. The device has been registered. I tried to send the API triggered push using the following REST API,
Host: https://www.exacttargetapis.com
POST /push/v1/messageContact/OEl8ODow/send
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
My code:
public static final String url = "https://www.exacttargetapis.com/push/v1/messageContact/" + PUSH_MESSAGE_ID + "/send ";
try {
URL url1 = new URL(url);
conn = (HttpURLConnection) url1.openConnection();
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Authorization", "Bearer " + accessTokenForCompaign);
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
try {
String req="{\n" +
" \"DeviceTokens\": [\n" +
"\"" + appData.getDeviceId() + "\"" +
"\n" +
" ],\n" +
" \n" +
" \"Override\": true,\n" +
" \"MessageText\": \"Dear "
+ userName +
" your information has been submitted successfully!\"\n" +
" \n" +
"}";
Log.e("JSON Input", req);
wr.writeBytes(req);
wr.flush();
wr.close();
} catch (Exception ex) {
ex.printStackTrace();
}
conn.connect();
conn.connect();
} catch (Exception e) {
e.printStackTrace();
}
return conn;
My request as follows,
{
"DeviceTokens": [
"C3816D87C06FAFBA969CF3398BBAF960DF308658DFF10E818CD16239FFDDAFA9"
],
"Override": true,
"MessageText": "Dear qwerty asdf your information has been submitted successfully!"
}
The response I got, and the response code is 202. And the push is not received to the mobile.
{"tokenId":"65fc5215-3a0b-4761-b76e-c9a0f8198651"}