Update Messages

Update the status of the message.

Operation Permissions

User login to Application Portal is not required.

Prerequisite

The associated application has been purchased by the organization.

Request Format

POST https://{apigw-address}/app-portal-service/v2.1/message/update

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

messages

Mandatory

MessageUpdateDTO Struct

The list of the messages that needs to be updated.

MessageUpdateDTO Struct

Name

Mandatory/Optional

Data Type

Description

messageId

Mandatory

String

The message ID.

accessKey

Mandatory

String

The service account of the application. The application authenticates with accessKey to obtain the data that it is authorized to access. How to get accessKey>>

state

Mandatory

Integer

The message status.

  • 0: Not processed

  • 1: Processed

Sample

Request Sample

url: https://{apigw-address}/app-portal-service/v2.1/message/update
method: POST
requestBody:
{
  "messages": [
    {
      "accessKey": "yourAccessKey",
      "messageId": "TestMessage0150000927",
      "state": 1
    }
  ]
}

Return Sample

{
  "code": 200,
  "message": "",
  "data": null
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void updateMessagesTest() {
        List<MessageUpdateDTO> messages=new ArrayList<>();
        MessageUpdateDTO messageUpdateDTO = new MessageUpdateDTO();
        messageUpdateDTO.setAccessKey("your_access_key");
        messageUpdateDTO.setMessageId("message_id");
        messageUpdateDTO.setState(1);
        messages.add(messageUpdateDTO);
        MessageUpdateRequest messageUpdateRequest = new MessageUpdateRequest();
        messageUpdateRequest.setMessages(messages);
        MessageUpdateResponse messageUpdateResponse = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                .url("https://{apigw-address}").getResponse(messageUpdateRequest, MessageUpdateResponse.class);
        System.out.println("Message Update: " + JSON.toJSONString(messageUpdateResponse));
    }
}