salesforce-marketingcloud / FuelSDK-Java

Salesforce Marketing Cloud Java SDK
BSD 3-Clause "New" or "Revised" License
72 stars 123 forks source link

[BUG] Message xxxx is not valid for the client. #136

Closed hak906 closed 1 year ago

hak906 commented 2 years ago

Describe the bug use interface /push/v1/messageList/{messageId}/send and report an error, "{"errors":["Message MTIwNToxMTQ6MA is not valid for the client."]}"

To Reproduce Steps to reproduce the behavior.

Expected behavior I want to send a message to the specified mobile devices of a push-enabled app through api.

Code snippet

@Test
  public void pushMessage() {
    String path = "/push/v1/messageList/MTIwNToxMTQ6MA/send";

    ETRestConnection connection = client.getRestConnection();
    String value = "{\n"
        + "    \"inclusionListIds\": [\n"
        + "        \"5de5df40-9e58-ec11-ba2c-d4f5ef424920\"\n"
        + "    ]\n"
        + "}";

    Response response = null;
    try {
      response = connection.post(path,value);
      System.out.println(response.getResponsePayload());
      System.out.println(response.getResponseMessage());
      System.out.println(response.getResponseCode());
    } catch (ETSdkException e) {
      e.printStackTrace();
    }
  }

Environment