Views: 280
Last Modified: 15.12.2023

Getting list of GIF-images in a string


Parameters

Parameter Example Required Description Revision
filter 32
filter.search 'test' Yes String, to search GIF images. 32
limit 15 No How many GIF images to get. 32
offset 15 No Offset. 32

Associated P&P events

No

Calling method and repsonse

JavaScript

BX.rest.callMethod('imbot.Giphy.list', {
	filter: {search: 'test'}
})
	.then(result => console.log(result.data()))
	.catch(result => console.error(result.error()))
;

Response example

[
	{
		"preview": "https://media4.giphy.com/media/gw3IWyGkC0rsazTi/200w_d.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200w_d.webp&ct=g",
		"original": "https://media4.giphy.com/media/gw3IWyGkC0rsazTi/200.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200.webp&ct=g"
	},
	{
		"preview": "https://media0.giphy.com/media/yNs2a0jRkYxy6191B2/200w_d.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200w_d.webp&ct=g",
		"original": "https://media0.giphy.com/media/yNs2a0jRkYxy6191B2/200.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200.webp&ct=g"
	},
	{
		"preview": "https://media2.giphy.com/media/3o8dFjB7T9lNldqliM/200w_d.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200w_d.webp&ct=g",
		"original": "https://media2.giphy.com/media/3o8dFjB7T9lNldqliM/200.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200.webp&ct=g"
	},
	{
		"preview": "https://media0.giphy.com/media/xT1XGWGd90BrYwnTl6/200w_d.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200w_d.webp&ct=g",
		"original": "https://media0.giphy.com/media/xT1XGWGd90BrYwnTl6/200.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200.webp&ct=g"
	},
	{
		"preview": "https://media4.giphy.com/media/8FNlmNPDTo2wE/200w_d.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200w_d.webp&ct=g",
		"original": "https://media4.giphy.com/media/8FNlmNPDTo2wE/200.webp?cid=b7142cb9hgdk6b19hsx8g5powaqrznauiaw5mc0uhjmpc4uu&rid=200.webp&ct=g"
	},
		...
]

Key description:

  • preview – animation preview with fixed width of 200 px, a version of original image reduced to 6 frames;
  • original – full animation version.

Possible error codes

  • Possible customer-related errors:

    Code Description
    EMPTY_SEARCH_ERROR String for searching GIF images cannot be empty.

  • Standard controller errors (for example, autowaring issue).
  • Server-related issue. Standard «microservice», module issues that include:
    • LICENSE_NOT_FOUND
    • WRONG_SIGN
    • LICENSE_DEMO
    • LICENSE_NOT_ACTIVE




Courses developed by Bitrix24