I'm trying to use the bulk/batch endpoint to batch a ton of requests at 50 requests a piece. I'm trying to just get this working in Postman first but I'm not able to figure out how to send all the data. I have the key set as a header and the JSON data as application/json data.
See screenshots https://i.imgur.com/p9QrQ2w.png and https://i.imgur.com/vUUMxiv.png
I've tried different ways to send this and always get 403 Forbidden (Access Denied).
What's the right way to send to this request?
Comments
{
"key": {{key}},
"request": [...]
}
There is one header but that's just defining the Content-type: application/json
I still get a 403 Access Denied.
Here's the full json data in case that is helpful https://gist.github.com/RedWolves/2d647b0c9c4d6ad931939cc40879ae80
Appreciate your help.
[ContentType]
application/x-www-form-urlencoded
[Data Structure]
key = secretkey
requests = {"requests": [{"endpoint":"inventory/update","request_method":"POST","params":[{"lot_id":"IDHERE","absolute_quantity":2}]}]}
[Response]
[{"req_num":1,"code":200,"body":{"status":"Success"}}]
[Example]
var jsonRequest = JsonConvert.SerializeObject(data, new JsonSerializerSettings()
{
NullValueHandling = NullValueHandling.Ignore,
StringEscapeHandling = StringEscapeHandling.EscapeNonAscii,
Converters = new List<JsonConverter>() { new BrickOwlApiDateTimeConverter() }
});
jsonRequest = jsonRequest.Replace("\"parameters\":", "\"params\":");
var query = new NameValueCollection();
query.Add("key", "MYSECRETKEY");
query.Add("requests", jsonRequest);
byte[] bytes = client.UploadValues(url, WebRequestMethods.Http.Post, query);
jsonResponse = Encoding.UTF8.GetString(bytes);