Comment obtenir la liste des régions enregistrées via l’API?

URL: http://www.namedoseusite.com.br/api_products_ots.php?af=zones

PHP Échantillon:

 // des zones d'échantillonnage

if ($ _get [& # 39; action & # 39;] == & # 39; zones & # 39;) {

$ Url = $ tabain_url. & # 39; /api_products_ors.php? Action = zones & # 39 ;;

$ data = array ("country_id" = & gt; $ _get [& # 39; country_id & # 39;] // id country (seul le nombre est réalisé) * Champ requis
));

$ data_string = json_encode ($ date);

$ Ch = curl_init ($ url);
Curl_setopt ($ ch, curlopt_customrequest, "post");
Curl_setopt ($ ch, curlopt_postfields, $ data_string);
Curl_setopt ($ ch, curlopt_returntransfer, true);
curl_setopt ($ ch, curlopt_ssl_verifypeer, false);
Curl_setopt ($ ch, curlopt_httpheader, array (
& # 39; Type de contenu: application / json & # 39;,
"Cache-Control: No-cache",
& # 39; token: & # 39; . base64_encode (token $),
& # 39; secret: & # 39; . base64_encode ($ secret),
& # 39; e-mail: & # 39; . base64_encode ($ e-mail),
& # 39; Content-Length: & # 39; . Strlen ($ data_string)))
));

$ result = curl_exec ($ ch);
Curl_close ($ ch);

print_r ($ result);

}

// Échantillon zones eof

Retour:

id
texte

Laisser un commentaire 0

Paramètre d’en-tête format
usuario1 base64_encode ()
Password1 base64_encode ()