Skip to content

Instantly share code, notes, and snippets.

@tonyalaribe
Created April 9, 2015 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyalaribe/998740db390d64a27d4c to your computer and use it in GitHub Desktop.
Save tonyalaribe/998740db390d64a27d4c to your computer and use it in GitHub Desktop.
JSON API sstructures and examples for pollo.io
{
"id": "poll id <unique>",
"pheader": "Heade or description text",
"qs": [
{
"qid": "question id <uniqe>",
"qtext": "question text",
"qtype": "question types:MC|YS|IN(m choice|yes or no|inpuy)",
"as": [
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
},
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
}
]
},
{
"qid": "question id <uniqe>",
"qtext": "question text",
"qtype": "question types:MC|YS|IN(m choice|yes or no|inpuy)",
"as": [
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
},
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
}
]
}
],
"pnotes": "any footer for poll"
}
{
"id": "poll id <unique>",
"pheader": "Heade or description text",
"qs": [
{
"qid": "question id <uniqe>",
"qtext": "question text",
"qtype": "question types:MC|YS|IN(m choice|yes or no|inpuy)",
"as": [
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
},
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
}
]
},
{
"qid": "question id <uniqe>",
"qtext": "question text",
"qtype": "question types:MC|YS|IN(m choice|yes or no|inpuy)",
"as": [
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
},
{
"aid": "answer id <unique>",
"atype": "type of answer: PT|TI|OI(plain text|text with image|only image)",
"answer": [
"answer text",
"image url"
]
}
]
}
],
"pnotes": "any footer for poll"
}
{
"key": "client key <unique> assigned at the time of registration",
"pid": "poll id sent by server",
"as": [
{
"qid": "question id sent by server",
"aid": "answer id sent by server in case of m choice"
},
{
"qid": "question id sent by server",
"aval": "input value of the user in case of input type question"
},
{
"qid": "question id sent by server",
"ays": true
}
]
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "object",
"properties": {
"key": {
"id": "http://jsonschema.net/key",
"type": "string"
},
"pid": {
"id": "http://jsonschema.net/pid",
"type": "string"
},
"as": {
"id": "http://jsonschema.net/as",
"type": "array",
"items": [
{
"id": "http://jsonschema.net/as/0",
"type": "object",
"properties": {
"qid": {
"id": "http://jsonschema.net/as/0/qid",
"type": "string"
},
"aid": {
"id": "http://jsonschema.net/as/0/aid",
"type": "string"
}
}
},
{
"id": "http://jsonschema.net/as/1",
"type": "object",
"properties": {
"qid": {
"id": "http://jsonschema.net/as/1/qid",
"type": "string"
},
"aval": {
"id": "http://jsonschema.net/as/1/aval",
"type": "string"
}
}
},
{
"id": "http://jsonschema.net/as/2",
"type": "object",
"properties": {
"qid": {
"id": "http://jsonschema.net/as/2/qid",
"type": "string"
},
"ays": {
"id": "http://jsonschema.net/as/2/ays",
"type": "boolean"
}
}
}
]
}
},
"required": [
"key",
"pid",
"as"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment