Badge

Badges gain you admittance to a Convention. You'll need the registration ConventionPrivilege to edit badges.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in BadgeProperties. It also has the following read-only properties:

shortname

A unique name that can be used to easily identify this badge.

Related Objects

See "Related Objects" in Introduction for how to use them.

badgetype

The BadgeType that this badge gets its configuration from.

booth

If this badge was assigned via an Exhibitor booth for free, then it will be attached to a Booth.

convention

The Convention this badge belongs to.

conventioncart

The ConventionCart this badge sits in (if any).

conventionreceipt

The ConventionReceipt showing the transaction history of this badge (if it was created via a checkout process).

discount

The Discount used on this badge (if any).

sponsor

If this badge was assigned via an Exhibitor sponsorship for free, then it will be attached to a Sponsor.

user

The User that controls this badge.

Relationships

See "Relationships" in Introduction for how to use them.

librarygamecheckouts

The list of LibraryGameCheckouts associated with this badge, if any.

logs

Activity information associated with this badge, if any.

playtowins

The PlayToWins associated with this badge, if any.

soldproducts

SoldProducts are merch items associated with the Badge (purchased or granted).

Qualifiers
badgetype_id
verified

tickets

Tickets associated with the Badge (purchased or granted).

Queryable
ticket_number
Qualifiers
badgetype_id
event_id
picked_up
verified

volunteershifts

If the badge's convention requires a badge to volunteer, the list of VolunteerShifts associated with the Badge, if any.

Includes

See "Includes" in Introduction for how to use them.

active_owner_account

If a badge is given via a TTE Friendship and a new User recipeint is created for the Badge, this flags if the user has logged in yet for the first time (activated their account). 1 means yes, 0 means no.

complimentary_event_availability

This include will set several values for the badge.

includes_simple_comp_tickets
includes_group_comp_tickets
includes_comp_tickets

Flags if the Badge's BadgeType includes any complimentary Tickets. 1 means yes, 0 means no. Simple comp tickets are ones for events available generally. Group comp tickets are ones for events available only via EventGroups. The third flag is for either.

unclaimed_simple_comp_tickets
unclaimed_group_comp_tickets
unclaimed_comp_tickets

Counts of any unclaimed complimentary Tickets allowed with the Badge. See above for distinctions between the different comp ticket categories.

unclaimed_comp_tickets_by_group

Count of unclaimed comp tickets by EventGroup ID, a la:

 {
   [id]: [count],
   ..
 }

complimentary_product_availability

This include will set two flags for the badge.

includes_complimentary_products

Flags if the Badge's BadgeType includes any complimentary Products. 1 means yes, 0 means no.

has_unclaimed_complimentary_product [without an -s]

Flags if the Badge has unclaimed complimentary Products. 1 means yes, 0 means no.

days

The ConventionDays covered by the Badge (actually its BadgeType).

has_complimentaries

Sets three flags for the Badge indicating if it has claimed complimentary SoldProducts or Tickets. 1 means yes, 0 means no.

has_comped_soldproducts

Whether the badge has claimed any complimentary merch.

has_simple_comped_tickets

Whether the badge has claimed any tickets complimentary outside of EventGroups.

has_group_comped_tickets

Whether the badge has claimed any tickets complimentary within EventGroups.

has_complimentary_products

Replaced with has_complimentaries, see above.

A flag indicating if the Badge has claimed complimentary Products (actually SoldProducts, merch). 1 means yes, 0 means no.

is_giving_via_email

If the Convention allows permissive gifting, flags if the purchaser is giving the Badge to a user who is not yet the purchaser's TTE friend (Friendship invitation is sent at completion of Badge purchase).

longname

A very descriptive name for this badge. It pulls data from several objects, which is why it is not included by default.

Services

The services used to fetch and manipulate badges.

Search Badges

This section describes basic searchability of badges, which is now available across several main badge endpoints.

Available Endpoints

To request badges, a user must make a request via an endpoint for a parent object. The parent objects for which this consolidated search behavior is valid are: User, Convention, and BadgeType. Departures/differences from basic behavior will be discussed in the documentation for the specific parent=>badge relationship. (The old endpoint GET /api/badge, which allowed searching across conventions and users, has been made admin-only.)

This search behavior is not available on the following relationships: ConventionCart, ConventionReceipt, Booth, Sponsor.

A user can always see badges which they own, or which belong to a convention for which the user has the registration or pos privilege. Outside of either of these "privileged" conditions, a user can view a badge that falls under either of the following two exceptions:

friendship

The user has a Friendship with the user who owns the badge; or, has a requested, but not accepted, Friendship with the user who owns the badge, IF settings for the user and convention are both set to allow "permissive gifting" (open conventions only).

order ownership

The user owns the order the badge is on (if any); that is, the badge's receipt or its cart.

Returns:

 {
    "paging" : {...},
    "items" : [
        {
          "id" : "xxx",
          "name_full" : "Joe User",
          ...
        },
        ...
    ]
 }
Optional Params
Queryables

Pass a string query to search for a partial match in specifically allowed text fields.

Queryable fields
badge_number
email
name_full
firstname

(can be searched only by specifying field with query_field=firstname; see options below)

lastname

(can be searched only by specifying field with query_field=lastname; see options below)

Queryable options
query_single_term

For badges, query now supports multiple match terms at once. To do this, merely separate your search terms with commas. So where the term "Smith Brown" will return any badge matching all of "Smith Brown", the term "Smith,Brown" will return all badges with names matching either Smith or Brown. (Any whitespace around the commas is automatically removed; "Smith, Brown" and "Smith ,Brown" are equivalent to "Smith,Brown".)

To prevent a query parameter with a comma in it from being split into multiple terms, include query_single_term=1.

query_field

By default, any use of query will search in the text fields email, badge_number, and name_full. You can make your search faster by specifying a single field with the query_field option. Simply set query_field to the field you want to search in. (Two fields, firstname and lastname, can be searched only using query_field.)

Qualifiers
badge_number
badgetype_id
booth_id
checked_in
convention_id
conventioncart_id
conventionreceipt_id
print_count
sponsor_id
user_id
verified

Create Badge

Generally you don't create badges this way, instead you do it through the ConventionCart API, or for organizers/admins via endpoint /api/badge/verified. This will put a badge in the system, but it will not be marked verified. It will still need to go through a checkout process or some other means of marking itself verified.

 POST /api/badge
Required Params
session_id
firstname
lastname
convention_id
badgetype_id

Returns the same as a normal read.

Administratively Create Badge

This will create a badge that is fully verified. You'll of course need to have the registration ConventionPrivilege to do this.

 POST /api/badge/verified
Required Params

Same as a normal badge creation.

If you specify the email field, the system will try to find a user account with that email, and then one of two things will happen. - If it finds a user account with that email, the badge will be attached to that user account. - If it does not, then TTE will create an account with that email address for the new badge, and TTE will send an email to the address asking the user to set a password for their account.

Note that TTE does not check if the email is in use on another badge. User account emails are unique, but badge emails cannot be. A user does not have to use the same email address on a badge that they have for their user account. So if you are creating a badge with an email address from another badge, because you want the new badge to belong to the same user/attendee, double-check with the user that you are using the email address that will identify their user account.

Returns the same as a normal read.

Read Badge

 GET /api/badge/xxx

Returns:

 {
   "id" : "xxx",
   "name_full" : "Joe User",
   ...
 }

Update Badge

 PUT /api/badge/xxx

Returns the same as a normal read.

Delete Badge

 DELETE /api/badge/xxx
Optional params
cashdrawer_id

You need to specify this to refund if purchased with cash in the point of sale system.

Returns:

 {
   "success" : 1
 }

Check-In Badge

 PUT /api/badge/xxx/check-in

Returns the same as a normal read.

Undo Badge Check-In

 PUT /api/badge/xxx/reverse-check-in

Returns the same as a normal read.

Assign New User To Badge

 POST /api/badge/xxx/user
Required Params
user_id

Returns the same as a normal read.

Convert Badge to Free

This refunds a charge for a badge without deleting it. Use of this endpoint requires the registration privilege.

 POST /api/badge/xxx/convert/free

Returns the same as a normal read.

Convert Badge

Convert a badge purchase to a different BadgeType. This will charge or refund the difference in the costs. This cannot be used for organizer-granted badges.

 POST /api/badge/xxx/convert/type/:badgetype_id
Required Params
badgetype_id

The ID of the BadgeType to convert the badge to.

Returns a normal read of the badge converted to.

Complimentary Tickets

Return a list of complimentary ticket associated with the badge.

 GET  /api/badge/xxx/tickets/complimentary

Returns a list as ../tickets would, but complimentary ones only.