Skip to main content

EmbedService

Embed service can be used in the following way:
1. Import the service from our library:

import {EmbedService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getAllEmbeds` will return the paginated list of embeds.

async getAllEmbeds() {
return await EmbedService.getAllEmbeds();
}
In case of required `params`, just add them inside the brackets.

async getSpecificEmbed(embedId) {
return await EmbedService.getSpecificEmbed(embedId);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).

1. Declare it(or declare them, it is possible to add multiple params)

const headers = headers: {Authorization: `Bearer ${yourToken}`}

2. Add it inside the brackets and pass it to the function, as shown in the previous example!

Constructors

new EmbedService()

new EmbedService(): EmbedService

Returns

EmbedService

Methods

createEmbed()

static createEmbed(data, config?): Promise<SCEmbedType>

Parameters

ParameterType
dataSCEmbedType
config?AxiosRequestConfig<any>

Returns

Promise<SCEmbedType>

Source

services/embed/index.ts:146


getAllEmbeds()

static getAllEmbeds(params?, config?): Promise <SCPaginatedResponse<SCEmbedType>>

Parameters

ParameterType
params?BaseGetParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCEmbedType>>

Source

services/embed/index.ts:138


getEmbedFeed()

static getEmbedFeed(embed_type?, embed_id?, config?): Promise <SCPaginatedResponse<SCFeedUnitType>>

Parameters

ParameterType
embed_type?string
embed_id?string
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCFeedUnitType>>

Source

services/embed/index.ts:162


getSpecificEmbed()

static getSpecificEmbed(id, config?): Promise<SCEmbedType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCEmbedType>

Source

services/embed/index.ts:150


getSpecificEmbedFeed()

static getSpecificEmbedFeed(id, config?): Promise <SCPaginatedResponse<SCFeedUnitType>>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCFeedUnitType>>

Source

services/embed/index.ts:166


patchASpecificEmbed()

static patchASpecificEmbed(id, data?, config?): Promise<SCEmbedType>

Parameters

ParameterType
idstring | number
data?EmbedUpdateParams
config?AxiosRequestConfig<any>

Returns

Promise<SCEmbedType>

Source

services/embed/index.ts:158


searchEmbed()

static searchEmbed(params?, config?): Promise <SCPaginatedResponse<SCEmbedType>>

Parameters

ParameterType
params?EmbedSearchParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCEmbedType>>

Source

services/embed/index.ts:142


updateASpecificEmbed()

static updateASpecificEmbed(id, data?, config?): Promise<SCEmbedType>

Parameters

ParameterType
idstring | number
data?EmbedUpdateParams
config?AxiosRequestConfig<any>

Returns

Promise<SCEmbedType>

Source

services/embed/index.ts:154