-
Notifications
You must be signed in to change notification settings - Fork 3
Creating gifs
To create a new gif, the following steps should be made:
- Upload the file to the server.
- Submit a gif.
- Wait for the gif to be ready.
To upload a file, you need to request an upload ticket, send the file, wait for it to be processed, then use the ticket id. See uploading files for detailed instructions. A ticket id is a UUID, which looks like this: "17fb69668eb-4b9f-6cae-9193-96690489d235".
When your file (upload ticket) is ready, you can send it to the API to create a gif.
Example request:
POST /v2/gifs/submit
Host: api.redgifs.com
Content-Type: application/json
Authorization: Bearer my_oauth_token
{
"ticket": "17fb69668eb-4b9f-6cae-9193-96690489d235",
"keepAudio": true,
"private": false,
"tags": [
"MILF",
"Mistress",
"Massage"
]
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache
{
"id": "palegoldenroddarkvioletibis",
"duration": 22
}
Here, "palegoldenroddarkvioletibis" is the unique gif id, and "duration" is the expected processing time. At this moment, the gif is currently in the draft state and is not accessible. Wait until it's been processed.
Request:
GET /v1/gifs/fetch/status/palegoldenroddarkvioletibis
Host: api.redgifs.com
Authorization: Bearer my_oauth_token
Response:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache
{
"task": "encoding",
"progress": 3
}
Here, "status" can be "encoding", "complete" or "error". You should repeat this request until the status is "complete" or "error".