Answer the question
In order to leave comments, you need to log in
Api Yandex.Delivery returns 504?
Actually code:
$data = array(
'senderId' => 'ИД Магазина',
'to' => array(
'location' => 'Калининград, Ленина, 10',
'geoId' => 22,
'postalCode' => '236006'
),
'dimensions' => array(
'length' => 5,
'width' => 3,
'height' => 5,
'weight' => 5.2
)
);
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, 'https://api.delivery.yandex.ru/delivery-options' );
curl_setopt( $curl, CURLOPT_PUT, true );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: OAuth Токен'
));
curl_setopt( $curl, CURLOPT_POSTFIELDS, json_encode( $data, JSON_UNESCAPED_UNICODE ) );
$output = curl_exec( $curl );
if ( $output === FALSE ) {
echo 'cURL Error: ' . curl_error( $curl );
return;
} else {
echo $output;
}
curl_close( $curl );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question