Forbidden 403 on POST Request / app script

Hello,

I'm looking for creating a new wishlist with this Google App Script :


function foo() {
var url = 'https://api.brickowl.com/v1/wishlist/create_list'
var data = {
'key' : '1ebf674f5a9650cdb0fa41246d53376f2f82333473baba9852e68754633c2c2f',
'name' : 'toto'
};
var options = {
'method' : 'post',
'contentType' : 'application/json',
'payload' : JSON.stringify(data)
};
var responsePost = UrlFetchApp.fetch(url, options)
Logger.log(responsePost)
}

All GET requests work but the Post requests sent me a 403 "access denied" error

An idea what i need to do ?

Thx a lot !

Comments

  • 4 Comments sorted by Votes Date Added
  • You’ll want to change your api key as that needs to be secret. Then the 403 will be due to incorrectly formatting the POST data, hopefully you can find a POST tutorial for your language
  • Hi there, I'm working on the same topics as Emmanuelle. I get the same error using Postman. Hopefully Postman is correctly formating the POST data. Any clue ?
  • If you post a screenshot of Postman, and blur the API key, I may be able to point you in the right direction
  • You were right, Lawrence, it was a matter of POST request syntax (arguments must be in the body). Thank you for your help.
Sign In or Register to comment.