I try to create custom spots with Ruby. Below my code which I entered in Rails Console:
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
list = { spot: "Person 1", topic: "Employee" }, { spot: "Person 2", topic: "Employee" }, { spot: "Person 3", topic:"Employee" }
lang = "nl"
spots_description = "List of employees"
spots_params = { data: { lang: lang, description: spots_description, list: list, token: token } }
spots_uri = URI.parse(spots_url)
spots_response = Net::HTTP.post_form(spots_uri, spots_params)
The response I receive is:
<Net::HTTPForbidden 403 Forbidden readbody=true>
JSON.parse(spots_response.body) gives following explanation:
{"error"=>true, "status"=>403, "code"=>"error.notAllowed", "message"=>"token param is missing", "data"=>{"parameter"=>"token"}}
Since I supply the token in the POST I figure it is in the wrong position.
Does anybody know what's wrong here?