@youon/posts-api-wrapper

2.10.0 • Public • Published

POSTS API WRAPPER

const { PostsApiClient } = require('@youon/posts-api-wrapper');
window.PostsApiClient = require('@youon/posts-api-wrapper').PostsApiClient;
import { PostsApiClient } from '@youon/posts-api-wrapper';

const endpoints = new PostsApiClient("host",1,"key","token");

Initial config

these params are passed in the constructor of VideoApiClient

Param Description
Host Api Host endpoint
Version Api Version
apiKey Api Key Available on Accounts APP
apiToken Api Token Available on Accounts APP

Methods

getCollections(params = null) 
getCollectionsSearch(params = null) 
getCollection(collectionId, params = null) 
getCollectionbyLanguage(collectionId, languageId, params = null) 
getCollectionAuthors(collectionId, params = null) 
getCollectionDossierAuthors(collectionId, dossierId, params = null) 
getCollectionPosts(collectionId, params = null) 
getCollectionDossiers(collectionId, params = null) 
getCollectionDossiersSearch(collectionId, params = null) 
getDossiersSearch(dossierId, params = null) 
getCollectionDossier(collectionId, dossierId, params = null) 
getCollectionDossierbyLanguage(collectionId, dossierId, params = null)  
getDossierCollections(dossierId, params = null) 
getCollectionDossierPosts(collectionId, dossierId, params = null) 
getAuthors(params = null) 
getAuthorsSearch(params = null) 
getAuthor(authorId, params = null) 
getAuthorPosts(authorId, params = null)   
getAuthorCollections(authorId, params = null) 
getAuthorDossiers(authorId, params = null) 
getPostsSearch(params = null) 
getPosts(params = null) 
getPreview(params = null) 
getPost(postId, params = null) 
getDossierPosts(dossierId, params = null) 
getCollectionDossierPostsSearch(collectionId, dossierId, params = null) 
getCollectionDossierPost(collectionId, dossierId, postId, params = null)
getCollectionDossierPostbyLanguage(collectionId, dossierId, postId, params = null)
getStickerGroups(params = null)
getGroupStickers(groupId, params = null)
getRelatedPosts(postId, params = null) 

Params

the params argument is an object that is transformed into a query

type Params = {[key:string]:any}

{ 
    include: "stickers,bodies,tags,photos,albums,authors,labels,audios,documents",
    filter[name]: "Vicente",
    filter[isoLanguage]: "pt,en",
    filter[author.variants.value]: 666,
    filter[author.publicId]: 666666,
    filter[dossier.publicId]: 666666,
    filter[post.publicId]: 666666,
    filter[custom_url]: "url-post",
    filter[sticker]: '89da5e82f4',
    sort: "-id,sticker.position",
    page: 1,
    per_page: 6
}
//&filter[isoLanguage]=pt,en&filter[tags.name]=tag&filter[createdAt][gte|lte]=2021-03-24T10:46:03
//&sort=id|-id|createdAt|-updatedAt
//&include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents
URI Description Query parameters Notes
getCollections(params = null) Return Collection list filter[isoLanguage]=pt,en
getCollectionsSearch(params = null) Return Collection list search filter[isoLanguage]=pt,en&filter[name]=xpto
getCollection(collectionId, params = null) Show information about a Collection ---
getCollectionbyLanguage(collectionId, languageId, params = null) Show information about a Collection by language filter[isoLanguage]=pt
getCollectionAuthors(collectionId, params = null) Return Authors list inside a Collection include=image,date,tags,authors&filter[isoLanguage]=pt&filter[name]=author_name
getCollectionDossierAuthors(collectionId, dossierId, params = null) Return Authors list inside a Dossier inside a Collection include=image,date,tags,authors&filter[isoLanguage]=pt&filter[name]=author_name&sort=createdAt
getCollectionPosts(collectionId, params = null) Return Posts list inside a Collection &filter[isoLanguage]=pt,en&filter[tags.name]=tag&filter[createdAt][gte]=2021-03-24T10:46:03&sort=id&include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[author.variants.name]=vicente
getCollectionDossiers(collectionId, params = null) Return Dossiers list inside a Collection filter[createdAt][lte]=2021-03-24T10:46:03
getCollectionDossiersSearch(collectionId, params = null) Return Dossiers list search inside a Collection filter[createdAt][lte]=2021-03-24T10:46:03&sort=id
getDossiersSearch(dossierId, params = null) Return Dossiers list search filter[createdAt][lte]=2021-03-24T10:46:03&sort=id
getCollectionDossier(collectionId, dossierId, params = null) Show information about a Dossier inside a Collection filter[isoLanguage]=pt&sort=-createdAt
getCollectionDossierbyLanguage(collectionId, dossierId, params = null) Show information about a Dossier inside a Collection by Language filter[isoLanguage]=pt
getDossierCollections(dossierId, params = null) Return Collections list inside a Dossier
getCollectionDossierPosts(collectionId, dossierId, params = null) Return Posts list inside a Dossier inside a Collection include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[isoLanguage]=pt
getAuthors(params = null) Return Authors list sort=-id
getAuthorsSearch(params = null) Return Authors list search filter[isoLanguage]=pt&sort=-id
getAuthor(authorId, params = null) Show information about a Author include=image,date,tags,authors
getAuthorPosts(authorId, params = null) Return Posts list from a Author include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[isoLanguage]=pt
getAuthorCollections(authorId, params = null) Return Collections list from a Author filter[isoLanguage]=pt
getAuthorDossiers(authorId, params = null) Return Dossiers list from a Author filter[isoLanguage]=pt
getPostsSearch(params = null) Return Posts list search include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[isoLanguage]=pt
getDossierPosts(dossierId, params = null) Return Posts list inside a Dossier include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[isoLanguage]=pt
getCollectionDossierPostsSearch(collectionId, dossierId, params = null) Return Posts list search inside a Dossier inside a Collection include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[isoLanguage]=pt
getCollectionDossierPost(collectionId, dossierId, postId, params = null) Show information about a Post inside a Dossier inside a Collection include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents
getCollectionDossierPostbyLanguage(collectionId, dossierId, postId, params = null) Show information about a Post search inside a Dossier inside a Collection include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents&filter[isoLanguage]=pt
getPosts(params = null) Return Posts list include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents
getPost(postId, params = null) Show information about a Post include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents
getRelatedPost(postId, params = null) Return Posts related to a Post include=stickers,bodies,tags,photos,albums,authors,labels,audios,documents

Readme

Keywords

none

Package Sidebar

Install

npm i @youon/posts-api-wrapper

Weekly Downloads

1

Version

2.10.0

License

MIT

Unpacked Size

25.3 kB

Total Files

4

Last publish

Collaborators

  • bgomes
  • psilva_uon
  • fmoreira_youon