INRIX IQ logo

The Users API may be used either to authenticate (log in) or register users. These users can been used to track consumers for features such as updating lot data or rewards.

IMPORTANT NOTES

Logging In

Users should be authenticated via the HTTP 1.1 Authentication via GET

Creating a User

Register User via the following:

Required parameters

email The user’s email address.
password The user’s password.
pub_id Publisher ID
source Agent creating user

Optional parameters

phone User’s phone number
city User’s city
first_name User’s first name
last_name User’s last name
gender User’s gender (male or female)
birthday User’s birthday
str_license_plate User’s license plate

Response Payload

The Response payload will be in the form of a JSON Object with a property called “User” which will contain all the details for the user.

{
    // User object returned by rate query
    UserCount: 1
    Users: [{

        // identifiers
        pk_user_profile: "10909a4c-85bb-11e1-a76e-12313f04e056",
        email: "john.doe@gmail.com",
        username: "john.doe@gmail.com",  // For all users that aren't anonymous
                                         // username and email are the same
        // permissions
        token: "b1239a4c-85bb-11e1-a76e-12313f04e056", // authentication token
        groups: [],
        user_permissions: [],
        is_staff: false,
        is_superuser: false,
        is_active: true,
        email_allowed: true,

        // other information
        first_name: "John",
        last_name: "Doe",
        i_opboard_logins: 17,
        note: "",
        location: "",
        phone: "310-857-8510",
        birthday: null,
        gender: null,
        i_parkme_points: 3500,

        // location information
        address: "",
        state: "",
        country: "United States",
        postal_code: "90254",

        // third party ids
        str_facebook_id: null,
        i_qp_account: null,

        // Date information
        date_joined: "2012-01-25T19:12:55Z",
        last_login: "2013-07-18T16:59:46.113Z",

    }, ...
    ]
}

Error Handling:

In the event that there is some ERROR in the request parameters, and/or a trappable error on the server, an Error Response payload will be returned:

{
    "ErrorCode":       1,             // 1 = Query Parameter Error
                                      // 2 = Server Error
                                      // 3 = Credentials Error
                                      // -1 = Other Error
    "ErrorDescription": "Missing uid" // String Description of the Error
}

Error codes are as follows:

# Generic Error Numbers
QUERY_PARAMETER_ERROR = 1
SERVER_ERROR = 2
CREDENTIALS_ERROR = 3
OTHER_ERROR = -1

# User Error Number (1000s)
EMAIL_EXISTS_ERROR = 1004  # An account with this email address already exists.
LOGIN_ERROR = 1005 #Your email address or password is incorrect. Please try again.

Updating a User

Update user’s payment via

curl -X PUT --user username:password
    -d 'card-number=4242424242424242&card_expiry_year=2020&card_expiry_month=5'
    https://api.devs.parkme.com/user/
curl -X PUT --user username:password
    -d "token=f5fa0f06-568f-11e5-94d0-22000ad5995e"
    https://api.devs.parkme.com/user/

Required Parameters

token A stripe token

or

card-number Card number on file
card_expiry_month 1-12 - either updated or original
card_expiry_year 4 digit year - either updated or original

Optional Parameters

card-expiry eg: “6 2018”, “6/2018” or “6-2018” in place of card_expiry_month & card_expiry_year
card-cvc 3 digit credit card cvv
phone User’s phone number
first_name User’s first name
last_name User’s last name
str_vehicle_name model name
str_license_plate user’s license plate
str_postal_code1 User’s postal/zip code (will come back as postal_code)

Response Payload

The Response payload will be in the form of a JSON Object with a property called “User” (see response object above) which will contain all the details for the user. The User’s information will be inside the zero index of the “Users” property.

Not all financial information will be returned, but the parameters listed above will be stored in the User’s payment profile.

Lots by User:

` curl –user username:password https://api.beta.parkme.com/user/e1ca28ee-eeb6-11e0-9775-12313d0151a1/lots/`

Response Payload

{
    "LotCount": 52,
    "Lots": [
        {
            "f_id": 52578,
            "address": "5252 Wisconsin Ave NW, Washington D.C., DC 20015, USA",
            "pk_lot": "21e33082-7f15-11df-b7d7-e0cb4e8adbbe",
            "name": "Chevy Chase Metro Center Parking",
            "point": [
                -77.085164416564893,
                38.958745092710203
            ]
        },
        {
            "f_id": 87281,
            "address": "1701 Pennsylvania Ave NW, Washington D.C., DC 20006, USA",
            "pk_lot": "3a228e6a-c28e-11df-81dd-123139143121",
            "name": "Whitehouse Visitor Parking",
            "point": [
                -77.039852145799998,
                38.899351928000002
            ]
        },...
    ]
}