https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi
Header Fields | Value | Mandatory |
---|---|---|
Content-Type | application/json | Ya |
Accept | application/json | Ya |
Authorization | Bearer YOUR_KEY | Ya |
curl --location --request GET 'https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL = "https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi",
CURLOPT_RETURNTRANSFER = true,
CURLOPT_FOLLOWLOCATION = true,
CURLOPT_ENCODING = "",
CURLOPT_MAXREDIS = 10,
CURLOPT_TIMEOUT = 30,
CURLOPT_HTTP_VERSION = CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST = "GET",
CURLOPT_HTTPHEADER = [
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'net/http'
require 'json'
require 'uri'
uri = URI("https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
req = Net::HTTP::Get.new(uri)
req['Accept'] = 'application/json'
req['Content-Type'] = 'application/json'
req['Authorization'] = "Bearer #{api_key}"
req.body = JSON[{'query' => query}]
puts(req.body)
http.request(req)
end
puts(res.body)
fetch("https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi", {
"method": "GET",
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}",
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
import http.client
conn = http.client.HTTPSConnection("api.kaltimprov.go.id")
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer {api_key}",
}
conn.request("GET", "https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.kaltimprov.go.id/api/generate/kaltim/dishub/transportasi?{params?}=xxx
Bila berhasil, response header yang akan diterima berupa kode status 200 OK dan response body akan berisi sebuah object dalam format JSON. Untuk galat, kode response header adalah error code dan response body akan berisi error object.