Search code examples
c#urlencodezoom-sdk

What does "double encoding" mean for a Zoom API URL?


In the Zoom Video SDK API documentation found here: https://marketplace.zoom.us/docs/api-reference/video-sdk/methods/#operation/sessionStatus it says

The session's ID. If the ID begins with a / character or contains // characters, you must double-encode the ID value.

The session ID is used in the URL itself, like /api/sessions/:sessionId/status. So having a '/' character in the URL does seem like a problem (and in practice, it is). For example, I can get a session id like "4I8wtN3QRkmf4izPrc/2qA==" What's not clear to me is what "double encoding" means here. I've tried:

  • URL encoding the session ID
  • Base64 encoding the session ID
  • "Data" escaping the session ID (from the Uri class)

But none of it results in a valid session ID according to Zoom. What am I expected to do to escape the / in the session id?

Note that if I get a session ID without a / in it, my code works perfectly. So the problem is definitley escaping that slash.


Solution

  • After a bunch more searching I found this post:

    https://devforum.zoom.us/t/double-encoding-on-uuids/50695

    Which shows an ID with the correct "double encoded" version. It had this token 4//M4niJTOCN0Sx/yjwA6w== with the correct encoding being 4%252F%252FM4niJTOCN0Sx%252FyjwA6w%253D%253D. Upon inspection, this appeared to be a double URL encoding. When I did:

    HttpUtility.UrlEncode(HttpUtility.UrlEncode(sessionId)

    the endpoint responds correctly.

    In short, the endpoint expects a double URL encoding of any id that contains a / (not just begins with or double as the documentation says).