List Kecamatan
List Kecamatan
Service ini digunakan untuk melihat list kode id dari kecamatan
Service Info
HTTP Method | GET |
---|---|
Service Code | 32 |
Http Method | GET |
Path | .../v1.0/list/kecamatan |
Authentication | OAuth 2.0 |
Header
Header Name | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
Content-Type | String | Y | application/json |
X-PARTNER-ID | String | Y | Client’s client_id (diberikan pada saat onboarding ) |
Params
Nama Field | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
id_kota | Integer | Y | Kode id dari list kota untuk menentukan list kecamatan |
- PARAMS
- CURL
- PHP
- NODE JS
- GO
?id_kota=253
curl --location --request GET '../v1.0/list/kota?id_kota=253' \
--header 'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'Authorization: Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7' \
--data-raw ''
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '../v1.0/list/kota?id_kota=253',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'Authorization: Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': '../v1.0/list/kota?id_kota=253',
'headers': {
'x-partner-id': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'Authorization': 'Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "../v1.0/list/kota?id_kota=253"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-partner-id", "6c57db4e-9e11-4951-9bcf-d6f177dafbcc")
req.Header.Add("Authorization", "Bearer 950c7e34-6365-4359-90f2-9bfaf88c51f7")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Response
Parameter | Tipe Data | Deskripsi |
---|---|---|
responseCode | String | Kode response |
responseMessage | String | Pesan response |
additionalInfo | Array Of Object | Informasi tambahan. |
id_kecamatan | Integer | id provinsi |
nama_kecamatan | String | Nama Kecamatan |
{
"responseCode": "2003200",
"responseMessage": "Successful",
"additionalInfo": [
{
"id_kecamatan": 3759,
"nama_kecamatan": "Arosbaya"
},
{
"id_kecamatan": 3755,
"nama_kecamatan": "Bangkalan"
},
{
"id_kecamatan": 3769,
"nama_kecamatan": "Blega"
},
{
"id_kecamatan": 3757,
"nama_kecamatan": "Burneh"
},
{
"id_kecamatan": 3772,
"nama_kecamatan": "Galis"
},
{
"id_kecamatan": 3760,
"nama_kecamatan": "Geger"
},
{
"id_kecamatan": 3758,
"nama_kecamatan": "Kamal"
},
]
}
List Response Code
Response Code | Response Message | Description |
---|---|---|
2003200 | Success | |
4003201 | Invalid field format { field name } | |
4013200 | Unauthorized. Invalid Signature | X-Signature salah |
4093200 | Cannot use same X-EXTERNAL-ID in same day | X-External-ID sudah pernah digunakan di hari yang sama |
4043201 | Bad Request | Request header ada yang salah / kurang |
4043200 | Unauthorized. Client Forbidden Access API | Partner tidak dapat mengakses api terkait |
5003201 | General Error | Terjadi kesalahan |