[QUIRKY] Setting Var Connector via Maker API causes errors for some chars

Someone please educate me here... are there certain ASCII/UTF-8 characters we are not allowed to send (or must urlEncode) via Maker API's setVariable method?

I've been testing the following URL with various input:

http://[hub_ip]/apps/api/6/devices/534/setVariable/123?access_token=[maker_token]

Most values work fine (e.g. 123, Stanley, etc.) and I get back the expected response, namely an XML object describing the setVariable event, and the corresponding String hub variable receives the assigned value.

However, some values (e.g. abc%, abc#, perhaps other punctuation marks?) cause Maker API to barf back various error conditions. For instance an argument of abc% tosses a Server Error 500 while others yield a nullinvalid token message!

Feel like I didn't get the memo on this limitation/requirement.

Maybe I should ask someone like @gopher.ny what officially constitutes "Best Practices" with regard to constructing the HTTP strings we send to Maker API?

Have you tried to URL-encode the problematic characters (like %)?

1 Like

Yes, and can confirm that remedies the immediate problem. I'm going to propose that this type of thing be more critically documented for future users.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.