curl "https://api.pnut.io/v0/polls" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"type\":\"general.poll\",
\"prompt\":\"What is Pnut to you?\",
\"options\":[
{
\"text\":\"My jam\"
},
{
\"text\":\"I'm jelly with it\"
},
{
\"text\":\"Almonds\"
},
{
\"text\":\"These options are nuts\"
}
],
\"duration\":20160,
\"is_public\":true
}" \
-X POST \
-H "X-Pretty-Json: 1"
curl "https://api.pnut.io/v0/posts?include_post_raw=1" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"text\":\"Attached is a poll -- answer it when you can :D\",
\"raw\":[
{
\"type\":\"io.pnut.core.poll-notice\",
\"value\":{
\"+io.pnut.core.poll\": {
\"poll_id\": 1,
\"poll_token\": \"token\"
}
}
}
]}" \
-X POST \
-H "X-Pretty-Json: 1"