Sign In

Statistics on the number of the Kingdom's Mission abroad by continent

Get dataset information V1.0 GET

Headers Table

#
​Head​​
​Value
Head Type
1​ ​Accept application/json​ ​Accept​

أمثلة الإستخدام

Examples

PHP

<?php
$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, 'APIURL');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = ["Accept: application/json"];
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($curl);

if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo $response;
}

curl_close($curl);
?>

PYTHON


​​​import requests
def test_request():
headers = { "Accept": "application/json" }
data = None
response = requests.get('APIURL​​'
, headers=headers, data=data)
print(response.text)

test_request()

JAVASCRIPT

fetch('APIURL​', {
method: 'GET',
headers: new Headers(
{ "Accept": "application/json" }
)
})
.then(response =>response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));


CURL

   curl -X GET 'https://opendata.mofa.gov.sa/opendataapi/kingdommissions​' -H "Accept: application/json"

الإستجابات المتوقعة

Status Code

200

{ "continent​": "String", "embassy": "String", "consulate": "String", "delegation": "String", "tradeOffice": "String", "overAll​": "Int"
}

404

​​
{
"transactionId": "String",
"error": {​
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}

429

{
"transactionId": "String",
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Please try again later."
}
}

500

{
"transactionId": "String",
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "An error occurred, please try again later."
}
}

503

{
"transactionId": "String",
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service is unavailable, please try again later."
}
}