Answer the question
In order to leave comments, you need to log in
Is it possible to send a POST request to api.direct.yandex from a client?
Actually, here is the description api.yandex.ru/direct/doc/concepts/JSON.xml , but is it possible to send a request from the client, without using the backend?
I do something like
var data = {
"method": "GetClientInfo",
"param": ["правильный_юзер"],
"locale": "ru",
"token": "правильный_токен"
};
$.ajax({
type: "POST",
url: "https://api.direct.yandex.ru/v4/json/",
dataType: "jsonp",
crossDomain: true,
data: data
});
Answer the question
In order to leave comments, you need to log in
most likely an API error like XMLHttpRequest cannot load https://api.direct.yandex.ru/v4/json/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'domain' is therefore not allowed access.
Try Postman . Perhaps Yandex does not support Cross Site Authentication. I didn’t go into details, but you probably specified the domain for your application and thus tied to the api. Therefore, requests are only possible from that domain.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question