Skip to main content

MediaApiClient

Contains all the endpoints needed to manage medias.

Constructors

new MediaApiClient()

new MediaApiClient(): MediaApiClient

Returns

MediaApiClient

Methods

chunkUploadMedia()

static chunkUploadMedia(data, bytesStart, bytesEnd, bytesTotal, config?): Promise<SCChunkMediaType>

This endpoint performs the chunk upload of a media with type image or document. The client must split the file into chunks and send to the server in series. After all the chunks have been uploaded the client must call the Chunk Upload Complete endpoint with the given upload_id parameter to finalize the upload and retrieve the Media. To perform chunk upload the request must contain Content-Range header with the information about the chunk(range of the chunk upload in the format bytes start-end/total)

Parameters

ParameterTypeDescription
dataChunkUploadParams
bytesStartnumber
bytesEndnumber
bytesTotalnumber
config?AxiosRequestConfig<any>

Returns

Promise<SCChunkMediaType>

Source

services/media/index.ts:36


chunkUploadMediaComplete()

static chunkUploadMediaComplete(data, config?): Promise<SCMediaType>

This endpoint completes the chunk upload and create the media.

Parameters

ParameterTypeDescription
dataChunkUploadCompleteParams
config?AxiosRequestConfig<any>

Returns

Promise<SCMediaType>

Source

services/media/index.ts:57


clickMedia()

static clickMedia(id, ip?, config?): Promise<any>

This endpoint saves a click on a specific media using ID.

Parameters

ParameterTypeDescription
idstring | number
ip?string
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/media/index.ts:81


createMedia()

static createMedia(data, config?): Promise<SCMediaType>

This endpoint creates a media.

Parameters

ParameterTypeDescription
dataMediaCreateParams
config?AxiosRequestConfig<any>

Returns

Promise<SCMediaType>

Source

services/media/index.ts:71


deleteMedia()

static deleteMedia(id, config?): Promise<any>

This endpoint deletes a media.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/media/index.ts:109


getSpecificMedia()

static getSpecificMedia(id, config?): Promise<SCMediaType>

This endpoint retrieves a specific media using ID.

Parameters

ParameterTypeDescription
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCMediaType>

Source

services/media/index.ts:90


updateMedia()

static updateMedia(id, image, config?): Promise<SCMediaType>

This endpoint updates a media.

Parameters

ParameterTypeDescription
idstring | number
imagestring
config?AxiosRequestConfig<any>

Returns

Promise<SCMediaType>

Source

services/media/index.ts:100