1. trying to use curl with json input:
curl -X POST -d '{"client_id":"1e7759d46b67c449","client_secret":"zvS0tyROcIx9WFN7KyI","grant_type":"password","username":"my_username","password":"my_password"}' -H "Content-Type=application/json" api.somesite.com/.../token
this gives a {"error":"invalid_request"}
2. trying tu use curl with multiple -F
curl -X POST -F "client_id=1e7759d46b67c449" -F "client_secret=zvS0tyROcIx9WFN7KyI" -F "grant_type=password" -F "username=my_username" -F "password=my_password" api.somesite.com/.../token
this gives the correct JSON output.
How can I make a makeJsonRequest working like the last curl call? btw I'm trying to use Fenix3, so I belive I'm stuck on 1.3.x API
After getting the access token this code works great:
var url = "api.somesite.com/.../getmydata";
var options = { :method => Comm.HTTP_REQUEST_METHOD_POST,
:headers => { "Content-Type" => Comm.REQUEST_CONTENT_TYPE_JSON }
var params = {
"access_token" => "52c6b1581b7759710304b77a|166db44fad7ef9776d559995cd06beeb"
};
Comm.makeJsonRequest(url,params,options, method(:onReceive));