Skip to content

REST Calls

alsaihn edited this page May 9, 2018 · 18 revisions

Available Endpoints

Attendee Off-Site Registration

Attendee On-Site Registration

Dealer Registration

Staff Registration

Utility

Attendee Off-site Registration

/registration/

This is the starting url for off-site attendee registration. Returns the standard attendee form for the default event.

POST: /registration/cart/add/

Add an attendee and their selected price level and options to the cart. More than one attendee can be added per checkout transaction. The user is redirected to the cart page on a successful add.

Post data schema:

{
    attendee: {
        firstName: "", lastName: "", 
        address1: "", address2: "", city: "", state: "", country: "", postal: "",
        phone: "", email: "", birthdate: "mm/dd/yyyy",
        badgeName: "", emailsOk: "true/false", surveyOk: "true/false", volDepts: "", asl: "true/false"
    }, 
    priceLevel: { id: X, options: [ { id: X, value: "" }, ... ] },
    event: ""
}

GET: /registration/cart/

Retrieve the current session's order item list and cart total.

Get data schema:

{ 
     total: XX.XX, 
     discount: {},
     order_items: [  ] 
}

POST: /registration/cart/remove/

Remove an attendee from the cart and clear objects from the database: attendee, order items, order options

Post data schema:

{ id: X }

GET: /registration/cart/abandon/

Drop all attendees from the cart and clear the session

POST: /registration/cart/discount/

Applies the discount to the cart in the current session. The checkout page should be reloaded after a successful call to display the new cart.

Post data schema:

{ discount: "" }

POST: /registration/cart/checkout/

There are two types of checkout: zero-sum and payment required. For zero-sum payments, the post data should be an empty object. The nonce item below is specific to square. If using a different merchant account you may need to pass credit card data and update the views.py file to accept those additional parameters.

Payment required post data schema:

{
    onsite: false,
    billingData: {
        cc_firstname: "", cc_lastname: "", 'email': "",
        address1: "", address2: "", city: "", state: "", country: "", postal: "",
        nonce: ""
    },
    charityDonation: "X.XX",
    orgDonation: "X.XX"
}

/registration/cart/done/

This is the ending url for the attendee registration workflow.

Attendee On-site Registration

/registration/onsite/

This is the starting url for on-site attendee registration. Returns the onsite registration form which does not take payment. Payment must be handled by some card-present method.

Dealer Registration

/registration/dealer/

This is the starting url for the dealer application workflow. This form does not take payment.

POST: /registration/dealer/addnew/

Add a dealer (and their relevant attendee info) to the database. No cart interaction. TableSize should be an id returned from the tables utility endpoint.

Post data schema:

{
    attendee: {
        firstName: "", lastName: "", address1: "", address2: "", city: "",
        state: "", country: "", postal: "", phone: "", email: "", birthdate: "mm/dd/yyyy"
        emailsOk: "true/false", surveyOk: "true/false",
        badgeName: ""         
    },
    dealer: {
        businessName: "", website: "",  description: "", license: "", 
        power: "true/false", wifi: "true/false", wall: "true/false", near: "", far: "",
        chairs: "", tables: "", partners: [{}], asstbreakfast: "true/false"
        reception: "true/false", artShow: "true/false", breakfast: "true/false", switch: "true/false",
        charityRaffle: "true/false", agreeToRules: "true/false", buttonOffer: "true/false"            
    },
    'event': ''
}

/registration/dealer/thanks/

This is the ending url for the dealer application workflow.

/registration/dealer/{token}/

This is the starting url for the dealer payment workflow. The token in the url must be the registration token from the dealer record.

POST: /registration/dealer/lookup/

Lookup a staff registration using a registration token and their email address. A located dealer record is loaded into the session and the user is redirected to the dealer infourl below to continue to the dealer checkout form.

Post data schema:

{ token: "", email: "" }

GET: /registration/dealer/info/

Retrieve the dealer currently in the session and return the info needed to populate the registration form.

Get data schema:

{
    dealer: {}, badge: {},
    jsonDealer: {}, jsonTable: {}, jsonAttendee: {}, jsonBadge: {}, jsonLevel: {}
}

POST: /registration/dealer/add/

Update some of the information already collected and record the price level requested. User is redirected to the invoice url on a successful add. Existing attendee and dealer ids must be passed back with the data.

Post data schema:

{
    attendee: {
        id: X,
        firstName: "", lastName: "", address1: "", address2: "", city: "",
        state: "", country: "", postal: "", phone: "", email: "", 
        emailsOk: "true/false", surveyOk: "true/false",
        badgeName: ""         
    },
    dealer: {
        id: X,
        businessName: "", website: "",  description: "", license: "", 
        power: "true/false", wifi: "true/false", wall: "true/false", near: "", far: "",
        reception: "true/false", artShow: "true/false", breakfast: "true/false", switch: "true/false",
        charityRaffle: "true/false", agreeToRules: "true/false", buttonOffer: "true/false", 
        asstbreakfast: "true/false"
    },
    'priceLevel': { 'id': X, 'options': [...] },
    'event': ''
}

GET: /registration/dealer/invoice/

Retrieve the current session's order item list and cart total.

Get data schema:

{ 
     total: XX.XX, 
     discount: {},
     order_items: [  ],
     dealer: {}
}

POST: /registration/dealer/checkout/

There are two types of checkout: zero-sum and payment required. For zero-sum payments, the post data should be an empty object. The nonce item below is specific to square. If using a different merchant account you may need to pass credit card data and update the views.py file to accept those additional parameters.

Payment required post data schema:

{
    billingData: {
        cc_firstname: "", cc_lastname: "", 'email': "",
        address1: "", address2: "", city: "", state: "", country: "", postal: "",
        nonce: ""
    },
    charityDonation: "X.XX",
    orgDonation: "X.XX"
}

/registration/dealer/done/

This is the ending url for the dealer payment workflow.

Staff Registration

/registration/newstaff/{token}

This is the starting url for new staff registration workflow. Only use this url if the new staff member has not already registered as an attendee as this workflow will create a new attendee record.

/registration/staff/{token}/

This is the starting url for existing or returning staff registration workflow. The token in the url must be the registration token from the staff record.

POST: /registration/staff/lookup/

Lookup a staff registration using a registration token and their email address. A located staff member is loaded into the session and the user is redirected to the /registration/staff url below to continue to the staff registration form.

Post data schema:

{ token: "", email: "" }

GET: /registration/staff/info/

Returns the staff registration form. The staff record must be loaded into the session after a successful match using the above token url.

Get data schema:

{
    staff: {}, badge: {},
    jsonStaff: {}, jsonDiscount: {}, jsonAttendee: {}, jsonBadge: {}, jsonLevel: {}
}

GET: /registration/staff/invoice/

Retrieve the current session's order item list and cart total.

Get data schema:

{ 
     total: XX.XX, 
     discount: {},
     order_items: [  ],
     staff: {}
}

POST: /registration/staff/checkout/

Returning staff are not expected to pay for a regular level badge. The upgrade form should be used for any staff who wish to upgrade to a sponsorship level.

Payment required post data schema:

{
    'attendee': {
        id: X,
        firstName: "", lastName: "", 
        address1: "", address2: "", city: "",  state: "", country: "",
        birthdate : "mm/dd/yyyy", phone: "", badgeName: ""
    }, 
    staff: {
        id: X, 
        twitter: "", telegram: "", shirtsize: X, 
        specialSkills: "", specialFood: "", specialMedical: "",
        contactPhone: "", contactName: "", contactRelation: ""
    },
    event': ''
}

/registration/staff/done/

This is the ending url for the staff registration workflow.

Utility

Shirt Sizes

GET: /registration/shirts/

Returns a list of valid shirt sizes and their database ids

Field Type Description
name string Display name
id integer Database id, needs to be returned with the attendee’s data

Example Return:

[{"name": "Small", "id": 1}, {"name": "Medium", "id": 2}, {"name": "Large", "id": 3}, {"name": "Extra Large", "id": 4}, {"name": "2x", "id": 5}, {"name": "3x", "id": 6}]

GET: /registration/pricelevels/

Returns a list of public price types valid for the current datetime, the base price and any options

Field Type Description
name string Display name
id integer Database id, needs to be returned with the attendee's data
base_price string Base cost for this price level. Will be formatted with two decimal places.
description string Benefit description for display to the attendee
options list List of required options that need to be chosen by the attendee and returned with their registration
options; id int Database id, needs to be returned with the attendee's data
options; name string Option display name
options; value double Option display cost; default is 0.00
options; type string One of: bool, string, int, list
options; list list An array of allowed values if the option type is list
options; required bool If this field is required, ex. selecting a shirt size for price levels that include one for free

Example Return:

[{"description": "Regular attendee description here", "base_price": "45.00", "options": [{"name": "Con Book", "required": false, "list": [], "value": "0.00", "type": "bool", "id": 2}], "name": "Attendee", "id": 3}, {"description": "Sponsor description", "base_price": "90.00", "options": [{"name": "Con Book", "required": false, "list": [], "value": "0.00", "type": "bool", "id": 3}, {"name": "T-shirt", "required": true, "list": [{"name": "Small", "id": 1}, {"name": "Medium", "id": 2}, {"name": "Large", "id": 3}, {"name": "Extra Large", "id": 4}, {"name": "2x", "id": 5}, {"name": "3x", "id": 6}], "value": "0.00", "type": "ShirtSizes", "id": 1}], "name": "Sponsor", "id": 4}, {"description": "Super Sponsor Description", "base_price": "150.00", "options": [{"name": "Con Book", "required": false, "list": [], "value": "0.00", "type": "bool", "id": 5}, {"name": "T-shirt", "required": true, "list": [{"name": "Small", "id": 1}, {"name": "Medium", "id": 2}, {"name": "Large", "id": 3}, {"name": "Extra Large", "id": 4}, {"name": "2x", "id": 5}, {"name": "3x", "id": 6}], "value": "0.00", "type": "ShirtSizes", "id": 4}], "name": "Super Sponsor", "id": 5}, {"description": "Elite Sponsor Description", "base_price": "235.00", "options": [{"name": "Con Book", "required": false, "list": [], "value": "0.00", "type": "bool", "id": 8}, {"name": "T-shirt", "required": true, "list": [{"name": "Small", "id": 1}, {"name": "Medium", "id": 2}, {"name": "Large", "id": 3}, {"name": "Extra Large", "id": 4}, {"name": "2x", "id": 5}, {"name": "3x", "id": 6}], "value": "0.00", "type": "ShirtSizes", "id": 7}, {"name": "Guest of Honor Dinner Tickets", "required": false, "list": [], "value": "40.00", "type": "int", "id": 6}], "name": "Elite Sponsor", "id": 6}, {"description": "Raven God description", "base_price": "675.00", "options": [{"name": "Con Book", "required": false, "list": [], "value": "0.00", "type": "bool", "id": 9}, {"name": "T-shirt", "required": true, "list": [{"name": "Small", "id": 1}, {"name": "Medium", "id": 2}, {"name": "Large", "id": 3}, {"name": "Extra Large", "id": 4}, {"name": "2x", "id": 5}, {"name": "3x", "id": 6}], "value": "0.00", "type": "ShirtSizes", "id": 10}, {"name": "Extra Guest of Honor Dinner Tickets", "required": false, "list": [], "value": "40.00", "type": "int", "id": 11}], "name": "Raven God", "id": 7}]

GET: /registration/departments/

The list of departments that be displayed in the volunteer interest section

Field Type Description
name string Display name
id integer Database id, needs to be returned with the attendee's data

Example Return:

[{"name": "Registration", "id": 2}, {"name": "Hospitality", "id": 3}, {"name": "Programming", "id": 4}, {"name": "Gaming", "id": 5}]

GET: /registration/tables/

Returns a list of valid dealer table sizes, available table options and their database ids

Field Type Description
name string Display name
id integer Database id, needs to be returned with the dealer's data
description string Description of table type
chairMin integer The minimum number of chairs the dealer can request
chairMax integer The max number of chairs the dealer can request. Should be the same number as chairMin if no choice should be offered.
basePrice string This table type’s base price, formatted to have two decimal points