CCD Client API receiving 301 Moved Permanently

I’m trying to implement the CCD Client API, as we’ve decided not to use Addressables due to how our content is managed.

But I’m encountering an odd behavior and I cannot figure out where I’m wrong.

In particular, I am trying to call this endpoint here:
https://.client-api.unity3dusercontent.com/client_api/v1/environments//buckets//release_by_badge/latest/

When using this endpoint in Postman it works just fine. However when using it in Unity, or rather .NET directly via the HttpClient, I receive a 401 Unauthorized response. After some sniffing is done, it turns out that my request is redirected due to a 301 Moved Permanently response. The redirected request doesn’t attach the Authorization header, however. That by itself can be managed but I don’t get why I’m redirected in the first place.

What’s even more confusing is, that the route I’m being redirected to is “/client_api/v1/environments//buckets//release_by_badge/latest/”, aka…the exact same path that I’ve requested in the first place. According to the HttpClient, the final request, that receives the 401 response is at “https://.client-api.unity3dusercontent.com/client_api/v1/environments//buckets//release_by_badge/latest/?Location=%2Fclient_api%2Fv1%2Fenvironments%2F*%2Fbuckets%2F*%2Frelease_by_badge%2Flatest

If anyone could point out to me what I might be doing wrong, that’d be greatly appreciated. Gotta be some logic error in my thinking or perhaps an absolute minimal typo? I can’t figure it out at all, however.

The endpoints that let you list the content of releases are not enabled by default. The “Permissions” section in the main API documentation has information about this.

https://content-api.cloud.unity3d.com/doc/

You will need to manually add the list-releases permission to the CreatePermissionByBucketEnv endpoint.

https://content-api.cloud.unity3d.com/doc/#/Permissions/CreatePermissionByBucketEnv

Once that’s done you should be able read from that endpoint.

That’s not the issue. The permissions were already set. As mentioned in my post, if I’m using Postman with the same value for the Authorization header, it works just fine. Just with the C# HttpClient I get redirected to the same link. So I was wondering whether that’s intentional.

Ah sorry, I missed that bit. And your original URL definitely has a trailing slash?

Oof…I didn’t even consider that. Yeah that fixed it. I had to put one on the other endpoints as well. But between the route and the start of the query parameter in case of the “diff” endpoints. A bit of an unusual choice that it depends on a slash being there.

Thanks for the tip, that solved the issue.