Wink - Access token issue

Is the whole JSON request supposed to be in a string format because that is what JSON.stringfy() does? Should only parts of the JSON request be in string format during the request?

Pretty sure it should all go in the stringify but I don’t know js could you send it through a proxy (like Charles proxy) and make sure the request looks good?

Could you show me how you sent a Wink request in python?

set_device_state in this file https://github.com/python-wink/python-wink/blob/master/src/pywink/api.py

Basically this

requests.put(url_string, data=json.dumps(state), headers=API_HEADERS)

API_HEADERS is a dictionary with the content type and the user agent and the token.

State is a JSON string.

URL string is the full URL

When you said to use Charles proxy, how do I set that up for my test? And how do I know if the request looks good?

I have no idea how you would send your app through Charles but maybe if you sent the entire system through Charles? Seeing it go though Charles you could see the JSON body being sent and the headers and everything.

Have you looked at this? https://github.com/winfinit/wink-js/blob/master/index.js