socialChoiceRequest
Generic and only request for the Social Choice service. It works as a PROXY: the request (HTTP method, path, query params and body) is sent to Swarm via the social_choice_me command, Swarm forwards it to the Social Choice API and returns the response to the user in the same shape, without any changes. Use it for every Social Choice endpoint (login, profile, links, stories, highlights, follow, reactions, notifications, suggestions, uploads, etc.) by passing the endpoint path and HTTP method.
Documentation
Try it now
Request parameters:
Call example:
socialChoiceRequest({
partnerId: 1,
method: 'POST',
path: '/api/v1/player/profile/change-profile',
data: {
nik: 'Lizaa',
title: 'Mona',
description: 'Software Enginner'
}
})Response examples:
{
code: 0,
rid: 'd29326',
data: {
result: 0,
result_text: 'OK',
details: {
error: false,
message: 'OK.',
data: {
id: 23047,
nikName: 'Lizaa',
title: 'Mona',
description: 'Software Enginner'
}
}
}
}Response parameters:
Additional Information:
PROXY
This is a proxy request. The SDK sends social_choice_me to Swarm with { path, method, params: { PARTNER_ID, WL_ID, ...params }, data }; Swarm forwards it to the Social Choice API and returns the result to the user in the same shape. No mapping or post-processing is applied.
Call example
socialChoiceRequest < SocialProfile > ({
method: 'POST',
path: '/api/v1/player/profile/link/add',
partnerId: 1,
data: {
title: 'YouTube',
url: 'https://youtube.com/@me'
},
})