Zapier can POST something like this when tickets are bought:
    {

        "ticket_type": "Individual (Regular)",
        "barcode": "12345678",
        "email": "demo@example.com"
    }
548260
def zapier_guest_hook(request):
    '''
    
    '''
    if request.META.get('HTTP_X_ZAPIER_SECRET', None) != settings.WAFER_TICKETS_SECRET:
        raise PermissionDenied('Incorrect secret')

    # This is required for python 3, and in theory fine on python 2
    payload = json.loads(request.body.decode('utf8'))
    import_ticket(payload['barcode'], payload['ticket_type'],
                  payload['email'])

    return HttpResponse("Noted\n", content_type='text/plain')
984555
def parse(self, ticket):
        
        if len(ticket) < self._min_ticket_size():
            raise TicketParseError(ticket, 'Invalid ticket length')

        digest_len = self._hash.digest_size * 2
        digest = ticket[:digest_len]

        try:
            time_len = 8
            time = int(ticket[digest_len:digest_len + time_len], 16)
        except:
            raise TicketParseError(ticket, 'Invalid time field')

        parts = ticket[digest_len + time_len:].split('!')
        if len(parts) != 3:
            raise TicketParseError(ticket, 'Missing parts')

        user_id = ulp.unquote(parts[0])
        tokens = ()
        if parts[1]:
            tokens = tuple((ulp.unquote(t) for t in parts[1].split(',')))

        user_data = ulp.unquote(parts[2])

        return TicketInfo(digest, user_id, tokens, user_data, time)
535057
def ticket_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/tickets/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
466786
def ticket_comment_make_private(self, ticket_id, id, data, **kwargs):
        ""
        api_path = "/api/v2/tickets/{ticket_id}/comments/{id}/make_private.json"
        api_path = api_path.format(ticket_id=ticket_id, id=id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
433591
def post_event_ticket_class(self, id, ticket_class_id, **data):
        
        
        return self.post("/events/{0}/ticket_classes/{0}/".format(id,ticket_class_id), data=data)
447677
def get_event_ticket_class(self, id, ticket_class_id, **data):
        
        
        return self.get("/events/{0}/ticket_classes/{0}/".format(id,ticket_class_id), data=data)
209213
def ticket_field_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/ticket_fields/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1147988
def get_activate_info(self, activate_ticket):
        
        return self._post(
            'card/membercard/activatetempinfo/get',
            data={
                'activate_ticket': activate_ticket,
            },
            result_processor=lambda x: x['info'],
        )
1325965
def get_attachments_ids(self, ticket_id):
        
        attachments = self.get_attachments(ticket_id)
        return [int(at[0]) for at in attachments] if attachments else attachments
716580
def write(self):
        
        if not hasattr(self, 'space'):
            raise AttributeError("A ticket must have a 'space' attribute before you can write it to Assembla.")

        if self.get('number'):  # Modifying an existing ticket
            method = self.space.api._put_json
        else:  # Creating a new ticket
            method = self.space.api._post_json

        return method(
            self,
            space=self.space,
            rel_path=self.space._build_rel_path('tickets'),
        )
526719
function __fetchTicketInfo(server, ticketid, callback) {

    assert(server.cache_folder);

    var filename = server._ticket_cache_file(ticketid);
    //xx console.log("filename " , filename.red);

    assert(_.isFunction(callback));

    var command = 'issues/' + ticketid.toString() + '.json?include=relations,journals';

    perform_http_get_transaction(server,command, function (err, txt) {

        txt = fixUnicode(txt);

        var ticket = null;
        try {
            var o = JSON.parse(txt);

            fs.writeFileSync(filename, JSON.stringify(o, null, " "));
            console.warn(" writing ", filename);
            ticket= o.issue;
        } catch (err) {
            console.log("error !".red, err.message);
            fs.writeFileSync("toto.txt", txt);
            callback(err);
            return;
            // the ticket may have been deleted
        }
        callback(null,ticket);

    });

}
219562
def tickets(self, extra_params=None):
        
        tickets = []
        for space in self.api.spaces():
            tickets += filter(
                lambda ticket: ticket.get('assigned_to_id', None) == self['id'],
                space.tickets(extra_params=extra_params)
            )
        return tickets
858077
protected function getTicketFromWeChat()
    {
        $url    = sprintf(self::TICKET_URL, $this->getAccessToken()->getAccessToken());
        $client = $this->getHttpClient();
        $client->setUrl($url);
        $client->setHeaderArray(['Content-Type: application/json']);

        if (!$client->exec()) {
            throw new Exception("error when get js api ticket from WeChat({$url})");
        }

        $result = json_decode($client->getResponse(), true);
        if (!(isset($result['ticket']) && (isset($result['expires_in'])))) {
            throw new Exception("error result when get js api ticket from WeChat({$url})");
        }

        return ['ticket' => $result['ticket'], 'expire'=> $result['expires_in']];
    }
1081916
def suspended_ticket_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/suspended_tickets/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
25398
def create_ticket(subject, tags, ticket_body, requester_email=None,
                  custom_fields=[]):
    

    payload = {'ticket': {
        'subject': subject,
        'comment': {
            'body': ticket_body
        },
        'group_id': settings.ZENDESK_GROUP_ID,
        'tags': tags,
        'custom_fields': custom_fields
    }}

    if requester_email:
        payload['ticket']['requester'] = {
            'name': 'Sender: %s' % requester_email.split('@')[0],
            'email': requester_email,
        }
    else:
        payload['ticket']['requester_id'] = settings.ZENDESK_REQUESTER_ID

    requests.post(
        get_ticket_endpoint(),
        data=json.dumps(payload),
        auth=zendesk_auth(),
        headers={'content-type': 'application/json'}).raise_for_status()
689044
def verify_ticket(self, ticket):
        """"""
        (response, charset) = self.get_verification_response(ticket)
        return self.verify_response(response, charset)
1349017
public function index()
    {
        $tickets = $this->paginate($this->Tickets);

        $this->set(compact('tickets'));
        $this->set('_serialize', ['tickets']);
    }