Publiez des stories et créez des sondages au nom d'un utilisateur ayant autorisé votre application via Login with GPChat.
/publicCreateStory — scope stories:write| Champ | Description |
|---|---|
type | text · image · video |
text | Requis pour type: text |
imageUrl | Requis pour type: image |
videoUrl / thumbnailUrl | Requis pour type: video |
curl -X POST https://api.gpchat.cm/v1/stories \
-H "Authorization: Bearer gpat_..." \
-H "Content-Type: application/json" \
-d '{ "type": "text", "text": "Publié depuis mon intégration !" }'
/publicGetMyStories — scope stories:readcurl https://api.gpchat.cm/v1/stories/mine \
-H "Authorization: Bearer gpat_..."
/publicDeleteStory — scope stories:writecurl -X DELETE https://api.gpchat.cm/v1/stories/delete \
-H "Authorization: Bearer gpat_..." \
-H "Content-Type: application/json" \
-d '{ "storyId": "STORY_ID" }'
Un sondage vit comme un message spécial dans une conversation 1-à-1 ou un groupe — indiquez toujours groupId ou receiverId.
/publicCreatePoll — scope polls:writecurl -X POST https://api.gpchat.cm/v1/polls \
-H "Authorization: Bearer gpat_..." \
-H "Content-Type: application/json" \
-d '{
"groupId": "GROUP_ID",
"question": "On se voit quand ?",
"options": ["Samedi", "Dimanche"],
"allowMultipleAnswers": false
}'
/publicVotePoll — scope polls:writecurl -X POST https://api.gpchat.cm/v1/polls/vote \
-H "Authorization: Bearer gpat_..." \
-H "Content-Type: application/json" \
-d '{ "groupId": "GROUP_ID", "messageId": "MSG_ID", "optionId": "OPTION_ID" }'
Voter deux fois pour la même option retire le vote (bascule). Un nouveau vote sur une autre option remplace le précédent, sauf si le sondage autorise les réponses multiples.
/publicClosePoll — scope polls:writecurl -X POST https://api.gpchat.cm/v1/polls/close \
-H "Authorization: Bearer gpat_..." \
-H "Content-Type: application/json" \
-d '{ "groupId": "GROUP_ID", "messageId": "MSG_ID" }'