Get Colors of the Message Icon

Get the list of colors for configuring the message icon.

Operation Permissions

User login to Application Portal is not required.

Request Format

GET https://{apigw-address}/app-portal-service/v2.0/message/enum/colors

Response Parameters

Name Data Type Description
data Data Struct The list of colors.

Data Struct

Name Data Type Description
colors Color Struct The details of the colors.

Color Struct

Name Data Type Description
id Integer The color ID.
name I18nString Specify the color name in its respective locale’s language. For more details on the structure and locales supported, see Internationalized name struct

Sample

Request Sample

url: https://{apigw-address}/app-portal-service/v2.0/message/enum/colors
method: GET

Return Sample

{
  "code": 200,
  "message": "",
  "data": {
    "colors": [
      {
        "id": 0,
        "name": {
          "default": "red",
          "en_US": "red",
          "zh_CN": "红色"
        }
      },
      {
        "id": 1,
        "name": {
          "default": "Yellow ",
          "en_US": "Yellow ",
          "zh_CN": "黄色"
        }
      },
      {
        "id": 2,
        "name": {
          "default": "Gray",
          "en_US": "Gray",
          "zh_CN": "灰色"
        }
      }
    ]
  }
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void getColorsOfTheMessageIconTest() {
        MessageColorRequest messageColorRequest = new MessageColorRequest();
        MessageColorResponse messageColorResponse = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
                .url("https://{apigw-address}").getResponse(messageColorRequest, MessageColorResponse.class);
        assertNotNull("Response should not be null", messageColorResponse);
        assertNotNull("Response data should not be null", messageColorResponse.data);
        assertEquals(3, messageColorResponse.data.colors.size());
    }
}