Appearance
API Get City List
API Get City List is an endpoint to retrieve a list of cities available in the Senmo system.
API Information
| Field | Value |
|---|---|
| Path | /api/{version}/general/cities |
| HTTP Method | GET |
| Service Code | 00 |
| Version | v1.0 |
| Type | JSON |
| Authentication | OAuth 2.0 with Access Token |
Request Structure
Request Header
Details
| Parameter / Field | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | M | String | Indicates the media type of the resource. Use: application/json |
Authorization | M | String | Represents the access_token. Starts with "Bearer" followed by the access token. e.g.: Bearer eyJraWQiOi... |
X-TIMESTAMP | M | String | Client's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format |
X-SIGNATURE | M | String | Symmetric signature using HMAC_SHA512. Formula: stringToSign = HTTPMethod + ":" + EndpointUrl + ":" + AccessToken + ":" + Lowercase(HexEncode(SHA256(minify(RequestBody)))) + ":" + TimeStamp. Notes: (1) Use full URL including all parameters. (2) If no Request Body, use empty string. |
X-PARTNER-ID | M | String | Unique partner ID. Use the Client ID obtained after the onboarding process. |
X-EXTERNAL-ID | M | String | Numeric String. A unique reference number you generate. Must be unique on the same day. |
ORIGIN | O | String | Origin domain registered on the iFortepay system. |
CHANNEL-ID | M | String | Device identification on which the API services are being accessed. Use value: api |
M = Mandatory, O = Optional
Request Body
ℹ️ There is no request body for this API.
Example Request
Details
artifact
id: get-city-list-request
name: Example Request - API Get City List
type: code.bash
content: |-
curl --location 'https://api-stage.senmo.id/api/v1.0/general/cities' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2023-06-12T12:00:00+07:00' \
--header 'X-SIGNATURE: 5Vle4LDvQ9xUnxaOFAljekGTZMgojaXTcCWoAbaXykn2WkE7IvBease//E3xgrMNy52eWeho19XBQ2FHmDBf7w==' \
--header 'X-PARTNER-ID: MCPD2312010070' \
--header 'X-EXTERNAL-ID: 1712120704399' \
--header 'CHANNEL-ID: api' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'Response Structure
Response Header
Details
| Parameter / Field | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | M | String | Indicates the media type of the resource (e.g. application/json) |
X-TIMESTAMP | M | String | Client's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format |
Response Body
Details
| Parameter / Field | Type | Length | Description |
|---|---|---|---|
responseCode | String | 7 | Response code |
responseMessage | String | 150 | Response description |
detailData | Array | - | List of city data |
detailData[].cityCode | String | - | City code (e.g. 1101) |
detailData[].cityName | String | - | City name |
additionalInfo | Object | - | Additional information (pagination) |
additionalInfo.totalData | Numeric | - | Total number of data records |
additionalInfo.pageSize | Numeric | - | Page size. Default: 10 records per page |
additionalInfo.pageNumber | Numeric | - | Current page number |
additionalInfo.totalPage | Numeric | - | Total number of pages available |
Example Response
Details
✅ Success Response
json
{
"responseCode": "2000000",
"responseMessage": "Successful",
"detailData": [
{ "cityCode": "1101", "cityName": "kabupaten simeulue" },
{ "cityCode": "1102", "cityName": "kabupaten aceh singkil" },
{ "cityCode": "1103", "cityName": "kabupaten aceh selatan" },
{ "cityCode": "1104", "cityName": "kabupaten aceh tenggara" },
{ "cityCode": "1105", "cityName": "kabupaten aceh timur" },
{ "cityCode": "1106", "cityName": "kabupaten aceh tengah" },
{ "cityCode": "1107", "cityName": "kabupaten aceh barat" },
{ "cityCode": "1108", "cityName": "kabupaten aceh besar" },
{ "cityCode": "1109", "cityName": "kabupaten pidie" },
{ "cityCode": "1110", "cityName": "kabupaten bireuen" }
],
"additionalInfo": {
"totalData": 516,
"pageSize": 10,
"pageNumber": 1,
"totalPage": 52,
"filter": {}
}
}