Skip to content

Instantly share code, notes, and snippets.

@aanari
Last active August 29, 2015 14:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aanari/7022af16522f0c18f323 to your computer and use it in GitHub Desktop.
Save aanari/7022af16522f0c18f323 to your computer and use it in GitHub Desktop.
Campaign Questions Spec

Campaign Questions


Get all of the questions for a campaign

GET https://api.tilt.com/campaigns/CMP12345

Response:

200 OK
{
    "campaign": {
        "id": 1,
        "guid": "CMP12345",
        "title": "Senior Prank: Dumpsville College",
        "description": "Let's get payback on that greedy shmuck!",
        "questions": [
            {
                "guid": "QUE12345",
                "type": "dropdown",
                "text": "What type of prank should we pull?",
                "options": [
                    {
                        "guid": "OPT12345",
                        "text": "Flood the library with crickets"
                    },
                    {
                        "guid": "OPT23456",
                        "text": "Toilet paper the auditorium"
                    },
                    {
                        "guid": "OPT45678",
                        "text": "Put the principal's car on the roof"
                    }
                ]
            },
            {
                "guid": "QUE23456",
                "type": "field",
                "text": "How many hours can you dedicate this week?"
            }
        ]
    }
}

Answer the campaign questions with a contribution

POST https://api.tilt.com/campaigns/CMP1234/contributions

Request:

{
    "contribution": {
        "amount": 1000,
        "answers": [
            {
                "question_guid": "QUE12345",
                "option_guid": "OPT12345",
                "answer": "Flood the library with crickets"
            },
            {
                "question_guid": "QUE23456",
                "answer": 4
            }
        ]
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment