Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi everyone!
The code below returns me an error: (400): Bad Request.
I know the error in the line below (to be more specific the problem is: "", ""filter"":{""since"": ""2019-12-10"", ""to"": ""2019-12-11""} 😞
body = "{""dir"": ""asc"", ""filter"":{""since"": ""2019-12-10"", ""to"": ""2019-12-11""}, ""status"":""delivered"", ""limit"": ""10"", ""offset"": ""0"" }",
but I don’t know exactly what syntax should be. May you help me with it?
The full code is:
let
url = "http://api-seller.ozon.ru/v2/posting/fbo/list",
body = "{""dir"": ""asc"", ""filter"":{""since"": ""2019-12-10"", ""to"": ""2019-12-11""}, ""status"":""delivered"", ""limit"": ""10"", ""offset"": ""0"" }",
Options=[Headers = [ #"client-id"="466", #"api-key"="-9753260e-2324-fde7-97f1-7848ed7ed097", #"Content-Type"="application/json"],Content = Text.ToBinary(body) ],
Source = Json.Document(Web.Contents(url,Options)),
in Source
HTTP Request example:
POST /v2/posting/fbo/list HTTP/1.1
Host: api-seller.ozon.ru
Client-Id: 466
Api-Key: 9753260e-2324-fde7-97f1-7848ed7ed097
Content-Type: application/json
{
"dir": "asc",
"filter":
{
"since": "2018-10-24T16:24:09.474Z",
"to": "2019-10-24T16:24:09.474Z"
},
"limit": 10,
"offset": 0
}
Hi @ArtemMsk
Please follow the guide in the similar thread.
Please ensure your network has access to the url.
I can't have access to the url on my side.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your reply.
I've checked the mentioned guide before. it was useful.
As for network access, there is no problem. For example, the following code works just fine:
let
url = "http://api-seller.ozon.ru/v1/product/info/stocks",
body = "{""page"": ""1"", ""page_size"": ""100""}",
Options=[Headers = [ #"client-id"="ххх", #"api-key"="хххх-хххх-хххх-хххх-хххх", #"Content-Type"="application/json"],Content = Text.ToBinary(body) ],
Source = Json.Document(Web.Contents(url,Options))
in Source
The same code but different line in the "body" part does not work: body = "{""dir"": ""asc"", ""filter"":{""since"": ""2019-12-10"", ""to"": ""2019-12-11""}, ""status"":""delivered"", ""limit"": ""10"", ""offset"": ""0"" }",
is it syntax of the code correct?
The problem solved. There is a wrong sequence in the parameters and format of the date.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
62 | |
40 | |
36 | |
28 | |
15 |