POST request with header

AIVA583

Пользователь
Регистрация
02.09.2022
Сообщения
56
Благодарностей
9
Баллы
8
Hi everyone I send post request but got an error 401 {"error":"Unauthenticated."}. I don't know what I am doing wrongly. Can someone help me! My post request looks like
97862
97863

97864

Last picture is documentation

Thanks for hepling
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 415
Благодарностей
5 900
Баллы
113
Not sure about your custom headers... why is user agent set as HTTP ?
and you don't need to specify content type application/json if you already selected it previously.
Try to set real values into your JSON data, not variables and check if the request works.
 
  • Спасибо
Реакции: AIVA583

AIVA583

Пользователь
Регистрация
02.09.2022
Сообщения
56
Благодарностей
9
Баллы
8
Not sure about your custom headers... why is user agent set as HTTP ?
and you don't need to specify content type application/json if you already selected it previously.
Try to set real values into your JSON data, not variables and check if the request works.
through the request post it sends a request to the server in my program 2 post request in the first dealer id 27 and 2 dealer id 26 the first post request works fine as soon as switching to 2 the request gives an error {"status":"error","error": "not unique"} or change dealer id to 27 works fine?
https://newlook.oki-toki.net/api/v1/contacts/add?api_token=api_token&fields[ИНН]={-Variable.INN-}&fields[КПП]={-Variable.KPP-}&fields[Компания]={-Variable.company-}&fields[Город]={-Variable.city-}&fields[Имя]={-Variable.full_name-}&fields[РТ]={-Variable.phone_number-}&fields[Какой сервис использует]={-Variable.goods-}&fields[ссылка]={-Variable.link-}&fields[Часовой пояс (ТШК)]={-Variable.time_zone-}&bp_id=19&dialer_id=27&queue_id=12761

https://newlook.oki-toki.net/api/v1/contacts/add?api_token=api_token&fields[ИНН]={-Variable.INN-}&fields[КПП]={-Variable.KPP-}&fields[Компания]={-Variable.company-}&fields[Город]={-Variable.city-}&fields[Имя]={-Variable.full_name-}&fields[РТ]={-Variable.phone_number-}&fields[Какой сервис использует]={-Variable.goods-}&fields[ссылка]={-Variable.link-}&fields[Часовой пояс (ТШК)]={-Variable.time_zone-}&bp_id=19&dialer_id=26&queue_id=12761 this request error I don't know what the problem
 

AIVA583

Пользователь
Регистрация
02.09.2022
Сообщения
56
Благодарностей
9
Баллы
8
solved someone already added this phone without permissiotion to the product
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)