T
T
thisall2021-05-31 15:45:18
Laravel
thisall, 2021-05-31 15:45:18

How to solve timeout with Yandex GO integration?

Good day, I want to set up integration with Yandex Go, but when I send a request, I get 504 timeout, maybe someone has already worked with this API

Documentation: https://yandex.ru/dev/logistics/api/ref/v2/ claims/...

$link = "b2b.taxi.yandex.net/b2b/cargo/integration/v2/claims/create?request_id={$order_id}";

        $items = [
            'callback_properties' => [
                'callback_url' => 'https://rest.yelm.io/api/integration/yandex/callback'
            ],
            'client_requirements' => [
                'cargo_options' => [
                    'thermobag', 'auto_courier'
                ],
                'taxi_class' => 'express'
            ],
            'emergency_contact' => [
                'name' => 'Пользователь',
                'phone' => $order->phone
            ],
            'items' => [
                [
                    'cost_currency' => 'RUB',
                    'cost_value' => $order->end_total,
                    'droppof_point' => $droppof_point,
                    'pickup_point' => $pickup_point,
                    'quantity' => 1,
                    'size' => [
                        'height' => 0.36,
                        'length' => 0.20,
                        'width' => 0.32
                    ],
                    'title' => "Заказ из магазина Енот №{$order->id}"
                ],
            ],
            'route_points' => [
                'route_points' => [
                    [
                        'address' => [
                            'coordinates' => [$order->longitude, $order->latitude],
                            'fullname' => $data->getResponse()->getFullAddress(),
                            'comment' => $order->comment,
                            'flat' => $order->flat,
                            'floor' => $order->floor
                        ],
                        'contact' => [
                            'name' => 'Пользователь',
                            'phone' => $order->phone
                        ],
                        'point_id' => $point_id,
                        'type' => 'source' 
                    ]
                ]
            ]
        ];

        $headers = [
            'Accept-Language' => 'ru',
            'Authorization' => "Bearer tyt token",
            'Content-Type' => 'application/json'
        ];

        $response = Http::withHeaders($headers)->post($link, $items);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
thisall, 2021-05-31
@thisall

There was a typo in the link

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question