-
Notifications
You must be signed in to change notification settings - Fork 3
Relaying requests
We use a CDN to deliver images and videos, and that CDN requires links to be signed. Links only work for the IP address they were issued for, that's normally the IP address that was used to get information about the gif from our API.
Sometimes you need your server scripts to get a link to then send it to the user's browser, so that they could display the linked media. This would not work directly, because your server's and your user's IP addresses differ, and the user would get a 403 error instead of the video.
For this to work, we have a special relaying feature. When requesting information on a gif, you provide the end user's IP address and user agent string, and we provide links signed for that user, not for your server. To use this feature, the link should include arguments user-addr
and user-agent
, and look like this:
https://api.redgifs.com/v2/gifs/bigbadwolf
?user-addr=123.4.5.6
&user-agent=iOS/v1.2.3.4.5
Please not that you need to use your application (client) token, not a user token.
This feature is not available to everyone. You need to apply for client credentials, then have your application explicitly given access to this feature. Otherwise you'd get a 403 errors. If you need this feature enabled, please contact us to discuss.