question

andrew-forsyth avatar image
andrew-forsyth asked ·

URL encoding of tilde (~) sign

I'm setting up an API connection to our management dashboard tool. It has strict URL encoding rules to poll APIs. So I can't ask it to poll:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/

Because the tilde should be escaped to be:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/%7e/

However if I try this URL (or without the trailing forward slash), Ringcentral returns a 401 error.

Any ideas?

Thanks,
Andrew

topic-default
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

anton-nikitin avatar image
anton-nikitin answered ·
Andrew,

according to RFC 2396 ( https://tools.ietf.org/html/rfc2396) :

2.3. Unreserved Characters
   Data characters that are allowed in a URI but do not have a reserved
purpose are called unreserved. These include upper and lower case
letters, decimal digits, and a limited set of punctuation marks and
symbols. unreserved = alphanum | mark mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" Unreserved characters can be escaped without changing the semantics
of the URI, but this should not be done unless the URI is being used 
   in a context that does not allow the unescaped character to appear.
At the same time we do support encoded tilde character. Your issue is most likely not because of a tilde escaping but due to missing or invalid access token provided in "Authorization" header.

Here is the example of successful request I could send:

GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/%7e HTTP/1.1 Accept-Encoding: gzip,deflate Authorization: Bearer SUFEMD...VKaUxDZ1lyS3pRVHRVVHBRfEFB


Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

andrew-forsyth avatar image
andrew-forsyth answered ·
Ah. Yes. Thanks.
Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.