تسجيل الدخول

إحصائية بالخدمات التي قدمتها إدارة شؤون السعوديين بالخارج لعام 2023م في ممثليات المملكة​

جلب معلومات مجموعة البيانات V1.0 GET

جدول الرؤوس

#
​الرأس​​
​القيمة ​نوع الرأس
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('https://opendata.mofa.gov.sa/opendataapi/SaudiCitizensAbroad​​'
, headers=headers, data=data)
print(response.text)

test_request()

JAVASCRIPT

fetch('https://opendata.mofa.gov.sa/opendataapi/SaudiCitizensAbroad​', {
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/SaudiCitizensAbroad​' -H "Accept: application/json"

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

Status Code

200

{
"ServiceType": "String",
"Total": "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."
}
}