Before you begin
- Sign up at Giphy and create a new app.
- Select API and click on Next.
- Enter your App name, description and click create.
- Make note of the API key that has been created.
Extension settings
- Login to CometChat and select your app.
- Go to the Extensions section and enable the Giphy extension.
- Click on the settings button and enter your Giphy API key and hit save.
How does it work?
This extension uses thecallExtension
method provided by the CometChat SDK. You can perform the following actions using this method:
- Get trending GIFs
- Search for GIFs
Get Trending GIFs
To list and show the most trending GIFs on Giphy, all you have to do is include the following parameters in your request.key | Value | Description |
---|---|---|
offset | number | Since you can get paginated results for trending GIFs, you can provide an offset and fetch results accordingly |
limit | number | The number of trending GIFs that you want to fetch |
- JavaScript
- Java
- Swift
Search for GIFs
Apart from listing the trending ones, the extension also allows searching for a particular GIF using the following parameters:key | value | Description |
---|---|---|
offset | number | Since you can get paginated results for searches, you can provide an offset and fetch results accordingly. |
limit | number | The number of GIFs that you want to fetch as part of the search. |
lang | 2-letter ISO 639-1 language identifier | (Optional) Defaults to en. (Example values: es, fr, it.) |
query | string | Search term |
- JavaScript
- Java
- Swift