MediaApiClient
Contains all the endpoints needed to manage medias.
Constructors
Constructor
new MediaApiClient():
MediaApiClient
Returns
MediaApiClient
Methods
chunkUploadMedia()
staticchunkUploadMedia(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
| Parameter | Type | Description |
|---|---|---|
data | ChunkUploadParams | |
bytesStart | number | |
bytesEnd | number | |
bytesTotal | number | |
config? | AxiosRequestConfig |
Returns
Promise<SCChunkMediaType>
chunkUploadMediaComplete()
staticchunkUploadMediaComplete(data,config?):Promise<SCMediaType>
This endpoint completes the chunk upload and create the media.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | ChunkUploadCompleteParams | |
config? | AxiosRequestConfig |
Returns
Promise<SCMediaType>
clickMedia()
staticclickMedia(id,ip?,config?):Promise<any>
This endpoint saves a click on a specific media using ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
ip? | string | |
config? | AxiosRequestConfig |
Returns
Promise<any>
createMedia()
staticcreateMedia(data,config?):Promise<SCMediaType>
This endpoint creates a media.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | MediaCreateParams | |
config? | AxiosRequestConfig |
Returns
Promise<SCMediaType>
deleteMedia()
staticdeleteMedia(id,config?):Promise<any>
This endpoint deletes a media.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise<any>
getSpecificMedia()
staticgetSpecificMedia(id,config?):Promise<SCMediaType>
This endpoint retrieves a specific media using ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
config? | AxiosRequestConfig |
Returns
Promise<SCMediaType>
updateMedia()
staticupdateMedia(id,image,config?):Promise<SCMediaType>
This endpoint updates a media.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | number | |
image | string | |
config? | AxiosRequestConfig |
Returns
Promise<SCMediaType>