Thursday, 15 September 2011

Parse.com Push Object/Message from Excel VBA -



Parse.com Push Object/Message from Excel VBA -

i trying write vba script force messages excel decives using parse.com framework. far succeeded in sending force info messages parse.com website multiple devices part should good.

problem getting vba send force or info parse.com in general. @ moment i'm trying connection work , force info in testobject class. using next code , authentication seems go how it's supposed now! set object gives error: invalid json

sub parse() targeturl = "https://api.parse.com/1/classes/testobject" set httpreq = createobject("winhttp.winhttprequest.5.1") ' httpreq.open "post", targeturl, false httpreq.setrequestheader "x-parse-application-id", "xxxxxx" httpreq.setrequestheader "x-parse-rest-api-key", "xxxxxx" httpreq.setrequestheader "content-type", "application/json" httpreq.send ("{foo:bar}") msgbox (httpreq.responsetext) end sub

new error:

invalid json

have set authentication? parse.com rest api reference:

request format

for post , put requests, request body must json, content-type header set application/json.

authentication done via http headers. x-parse-application-id header identifies application accessing, , x-parse-rest-api-key header authenticates endpoint. in examples follow, keys app included in command. can utilize drop-down build illustration code other apps.

you may authenticate rest api requests using basic http authentication. example, retrieve object set url using parse credentials in next format:

https://myappid:javascript-key=myjavascriptkey@api.parse.com/1/classes/gamescore/ed1nuqpvcm

for javascript usage, parse cloud supports cross-origin resource sharing, can utilize these headers in conjunction xmlhttprequest.

excel vba api excel-vba parse.com

No comments:

Post a Comment