Share
The share
API is used to share a message to the user's feed.
Request Parameter
Facebook
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter facebook for Facebook. | Required |
app_id | string | Unique app ID of the Facebook app | Required |
href | string | Link attached to the shared post | Required |
display | string | Dialog box rendering methods: page iframe popup touch For more information, see Share Dialog. | Optional |
redirect_uri | string | Redirect URL for clicking the button in the dialog | Optional |
Kakao
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter kakao for Kakao. | Required |
shareType | string | Share type story: Kakao story talk: Kakao talk | Required |
jsKey | string | kakao jskey | Required |
href | string | URL of the shared page When shareType is story , set title, background image and other settings to the shared page. | |
text | string | Automatically enterted text Set to a null string when default text is not required. | Require when shareType is story |
imageUrl | string | Background image URL of the shared page | Require when shareType is talk |
title | string | Title of the shared page | Require when shareType is talk |
description | string | Description of the shared page | Optional but pay attention when shareType is talk |
Twitter
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter twitter for Twitter. | Required |
url | string | Shared URL that is automatically shortened in a Tweet A Twitter Card may appear for the shared URL. | Optional |
via | string | Use the via parameter to tag users (@username) | Optional |
text | string | Preview of the text in Tweet editor Tweet author can easily delete text with a single delete action. | Optional |
hashtags | string | Use the hashtags parameter to add a comma-separated list of hashtags to Tweets | Optional |
VK
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter vk for VK. | Required |
url | string | URL of the shared content | Required |
image | string | Image URL | Optional |
title | string | Title of the shared content | Optional |
Request Sample
accountApi.share({
third_type: 'facebook',
href: 'https://test-common-web.intlgame.com/jssdk/map-demo.html',
hashtag: '#facebook',
app_id: 'xxxxx',
display: 'page',
redirect_uri: 'https://test-common-web.intlgame.com/jssdk/map-demo.html',
}).then((e)=>{
(res) => {
console.log(res);
}
});
Response Paramter
Parameter | Type | Description |
---|---|---|
ret | number | Return code 0: Request success !=0: Request failure, see msg for detailed return message |
msg | string | Return message |