Skip to content

User API

Set User Account PIN

Set a 4-digit PIN for a given device_id.

plaintext
POST /api/v2/createPIN

Request Parameters

Body ParametersTypeRequiredDescription
device_idstringYESUUIDv4 String for device_id
pinnumber(4)YES4-digit PIN associated with device_id
session_idstringYESUser Session ID Token

Success Response

json
{
	"response": true,
	"exception": null
}

IMPORTANT

The API Wrapper enforces a 4-digit PIN, however CBORD's base API seemingly allows any 4-char string.

Failure Response

Invalid PIN Provided
json
{   
    "response": null,
    "exception": "Invalid PIN Provided. Please ensure PIN is 4 digits." 
}
Unexpected Error
json
{
	"response": null,
	"exception": "Unexpected Error"
}

NOTE

There is the possibility that CBORD's endpoint returns an error. The above error seems to be the most relevant, but all 4-digit PINs should work since that's their App Requirement, which this API is enforcing, despite their API not.

Retrieve User Profile

Retrieves User Data associated with a User Profile.

plaintext
POST /api/v2/user

Request Parameters

Body ParametersTypeRequiredDescription
session_idstringYESUser Session ID Token

Success Response

A Really Long JSON Object
json
{
	"response": {
		"id": "{USER_ID_REDACTED}",
		"userName": "{USER_EMAIL_REDACTED}",
		"objectRevision": 128,
		"institutionId": "{USER_INSTITUTION_ID_REDACTED}",
		"firstName": "FIRST",
		"middleName": "MIDDLE",
		"lastName": "LAST",
		"status": 3,
		"staleProfile": false,
		"active": true,
		"timeZone": "America/New_York",
		"locale": "en-US",
		"cashlessMediaStatus": 1,
		"guestUser": false,
		"hasCashlessCard": true,
		"lastUpdatedCashless": null,
		"lastUpdatedProfile": "2024-07-04T01:00:00.000+0000",
		"emailBounceMessage": null,
		"emailBounceStatus": null,
		"childUserInfoList": [],
		"userNotificationInfoList": [
			{
				"id": "{UUIDV4_IDENTIFIER}",
				"type": 2,
				"value": "{USER_PHONE_NUMBER}",
				"provider": null,
				"status": 3,
				"bounceStatus": 1,
				"objectRevision": 1
			},
			{
				"id": "{UUIDV4_IDENTIFIER}",
				"type": 1,
				"value": "{USER_EDU_EMAIL_ADDRESS}",
				"provider": null,
				"status": 1,
				"bounceStatus": 1,
				"objectRevision": 1
			},
			{
				"id": "{UUIDV4_IDENTIFIER}",
				"type": 8,
				"value": "{A_TOKEN_THAT_LOOKS_LIKE_FIREBASE_CLOUD_MESSAGE_TOKEN}",
				"provider": "ios",
				"status": 3,
				"bounceStatus": 1,
				"objectRevision": 1
			},
			{
				"id": "{UUIDV4_IDENTIFIER}",
				"type": 8,
				"value": "{A_TOKEN_THAT_LOOKS_LIKE_FIREBASE_CLOUD_MESSAGE_TOKEN}",
				"provider": "ios",
				"status": 3,
				"bounceStatus": 1,
				"objectRevision": 1
			}
		],
		"userMediaInfoList": null,
		"email": "{USER_EDU_EMAIL_ADDRESS}",
		"phone": "{USER_PHONE_NUMBER}"
	},
	"exception": null
}

NOTE

Not entirely sure how response.userNotificationInfoList is generated. You may have all, some, or none of them.

Get User Favorited Locations

Retrieves User Data associated with a User Profile.

plaintext
POST /api/v2/getUserFavoritedLocations

Request Parameters

Body ParametersTypeRequiredDescription
session_idstringYESSession Token
latitudenumberYESCurrent latitude position
longitudenumberYESCurrent longitude position
auto_renew_sessionbooleanNOSet true if you want to automatically renew session_id token
device_idstringOnly if auto_renew_session is set to trueDevice ID for renewing session_id token
pinnumber(4)Only if auto_renew_session is set to truePIN set for Device when logging into app. See /createPIN for additional details

Success Response

json
{
    "response": [
		{
			"locationId": "{LOCATION-ID-NUMBER}",
			"name": "{LOCATION-NAME}",
			"type": "Normal",
			"latitude": 42.000000000,
			"longitude": -71.000000000,
			"distance": 0.0,
			"color": "#0099cc",
			"score": 20.0
		},
		// MORE LOCATIONS AS NEEDED
	],
    "exception": null,
    "autoRenewConfig": {
		"sessionIdChanged": true,
		"token": "{RENEWED_SESSION_ID}"
	}
}

Set User Favorited Locations

Sets list of User Favorited Locations

plaintext
POST /api/v2/setUserFavoritedLocations

Request Parameters

Body ParametersTypeRequiredDescription
session_idstringYESSession Token
location_idsstringYESCSV of Location IDs.
auto_renew_sessionbooleanNOSet true if you want to automatically renew session_id token
device_idstringOnly if auto_renew_session is set to trueDevice ID for renewing session_id token
pinnumber(4)Only if auto_renew_session is set to truePIN set for Device when logging into app. See /createPIN for additional details

Success Response

json
{
    "response": true,
    "exception": null,
    "autoRenewConfig": {
		"sessionIdChanged": true,
		"token": "{RENEWED_SESSION_ID}"
	}
}

Validate User Session Token

Checks whether SESSION_ID token is associated with a User Profile.

plaintext
POST /api/v2/validate

Request Parameters

Request ParametersTypeRequiredDescription
session_idstringYESUUIDv4 token for authorizing user access

Success Response

json
{ "session_valid": true }

Failure Response

json
{ "session_valid": false }

Get User Cashless Key ID (Patron ID)

Gets a user's cashless key id, aka their Patron ID.

plaintext
POST /api/v2/getUserCashlessKeyId

Request Parameters

Body ParametersTypeRequiredDescription
session_idstringYESUser Session ID Token
auto_renew_sessionbooleanNOSet true if you want to automatically renew session_id token
device_idstringOnly if auto_renew_session is set to trueDevice ID for renewing session_id token
pinnumber(4)Only if auto_renew_session is set to truePIN set for Device when logging into app. See /createPIN for additional details

Success Response

json
{
	"response": {
		"id": null,
		"userId": "${USER_ID_UUID_V4_STRING}$",
		"name": "CashlessKey",
		"value": "${CASHLESS_KEY_ID_AKA_PATRON_ID}$"
	},
	"exception": null
}