Get Organization Language List¶
Get the list of languages available for an organization.
Operation Permissions¶
User login to Application Portal is not required.
Request Format¶
GET https://{apigw-address}/app-portal-service/v2.2/organization/language/get
Request Parameters (URI)¶
Name | Location (Path/Query) | Mandatory/Optional | Data Type | Description |
---|---|---|---|---|
orgId | Query | Mandatory | String | The organization ID. |
Response Parameters¶
Name | Data Type | Description |
---|---|---|
data | Data Struct | The list of language codes. |
Data Struct¶
Name | Data Type | Description |
---|---|---|
languages | List<String> | The list of language codes. |
Samples¶
Request Sample¶
url: https://{apigw-address}/app-portal-service/v2.2/organization/language/get?orgId={your_org_id}
method: GET
Return Sample¶
{
"code": 0,
"message": "OK",
"data": {
"languages": [
"en-US",
"zh-CN"
]
}
}
Java SDK Sample¶
public class AppPortalSdkTest{
@Test
public void getOrganizationLanguageTest() {
OrganizationLanguageRequest organizationLanguageRequest = new OrganizationLanguageRequest("your_org_id");
OrganizationLanguageResponse organizationLanguageResponse = Poseidon.config(PConfig.init().appKey("your_access_key").appSecret("your_secret_key").debug())
.url("https://{apigw-address}").getResponse(organizationLanguageRequest, OrganizationLanguageResponse.class);
System.out.println("Get organization languages res: " + JSON.toJSONString(organizationLanguageResponse));
assertNotNull("Response should not be null", organizationLanguageResponse);
assertNotNull("Response data should not be null", organizationLanguageResponse.data);
assertNotNull("Organizations should not be null", organizationLanguageResponse.data.languages);
assertThat("Organizations should not be empty", organizationLanguageResponse.data.languages, not(IsEmptyCollection.empty()));
}
}