Skip to content

API Get City List

API Get City List is an endpoint to retrieve a list of cities available in the Senmo system.


API Information

FieldValue
Path/api/{version}/general/cities
HTTP MethodGET
Service Code00
Versionv1.0
TypeJSON
AuthenticationOAuth 2.0 with Access Token

Request Structure

Request Header

Details
Parameter / FieldMandatoryTypeDescription
Content-TypeMStringIndicates the media type of the resource. Use: application/json
AuthorizationMStringRepresents the access_token. Starts with "Bearer" followed by the access token. e.g.: Bearer eyJraWQiOi...
X-TIMESTAMPMStringClient's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format
X-SIGNATUREMStringSymmetric 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-IDMStringUnique partner ID. Use the Client ID obtained after the onboarding process.
X-EXTERNAL-IDMStringNumeric String. A unique reference number you generate. Must be unique on the same day.
ORIGINOStringOrigin domain registered on the iFortepay system.
CHANNEL-IDMStringDevice 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 / FieldMandatoryTypeDescription
Content-TypeMStringIndicates the media type of the resource (e.g. application/json)
X-TIMESTAMPMStringClient's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format

Response Body

Details
Parameter / FieldTypeLengthDescription
responseCodeString7Response code
responseMessageString150Response description
detailDataArray-List of city data
detailData[].cityCodeString-City code (e.g. 1101)
detailData[].cityNameString-City name
additionalInfoObject-Additional information (pagination)
additionalInfo.totalDataNumeric-Total number of data records
additionalInfo.pageSizeNumeric-Page size. Default: 10 records per page
additionalInfo.pageNumberNumeric-Current page number
additionalInfo.totalPageNumeric-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": {}
  }
}

iFortepay API Documentation