UNPKG

@nguyennhuy/zalo-api

Version:

Unofficial Zalo API for JavaScript

32 lines (28 loc) 1.07 kB
'use strict'; var ZaloApiError = require('../../Errors/ZaloApiError.cjs'); var utils = require('../../utils.cjs'); const getPersonalBoardPinListFactory = utils.apiFactory()((api, ctx, utils) => { const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend_board[0]}/api/friendboard/list`); /** * get friend board pin list * * @throws ZaloApiError * */ return async function getPersonalBoardPinList(conversationId) { const params = { conversationId, version: 0, imei: ctx.imei, }; const encryptedParams = utils.encodeAES(JSON.stringify(params)); if (!encryptedParams) throw new ZaloApiError.ZaloApiError("Failed to encrypt params"); const urlWithParams = `${serviceURL}&params=${encodeURIComponent(encryptedParams)}`; const response = await utils.request(urlWithParams, { method: "GET", }); return utils.resolve(response); }; }); exports.getPersonalBoardPinListFactory = getPersonalBoardPinListFactory;