Users

Register new users and/or obtain details about current ones.

Students ready to print

Becoming a user of Wepa means the ability to upload and print documents via kiosk. Most all users are students that have either registered themselves or have been created automatically through integrations with campus directories.

A user resource is a representation of a particular user in terms of data attributes like first name, last name, and email address. Through Wepa API, user resources can be retrieved and/or created through standard HTTP URI requests.

Createhttps://api.wepanow.com/resources/users/new

  • POST
  • application/x-www-form-urlencoded

Given adequate permission, new users may be created at any time via HTTP POST request. Things like first name, last name, email, and school are all required, and must be sent along as form parameters in the body of the message.

Example 2.1 - Request to create a new Wepa user
POST https://api.wepanow.com/resources/users/new HTTP/1.1

Authorization: Bearer uceef192-04c6-4603-afcf-9463ed66135f 
Content-Type: application/x-www-form-urlencoded 

username=jtest@myuniversity.edu 
password=A3ddj3w 
groupId=4  
firstName=John  
lastName=Test
userType=1
billingId=2

Updatehttps://api.wepanow.com/resources/users/update/{username}

  • POST
  • application/x-www-form-urlencoded

Existing users may be updated at any time after initially created. Supported parameters are the same as those of the create url, with the addition of password reset parameters. Given a proper reset hash obtained by the website, and existing credentials, a user's password may be reset.

Example 2.1 - Request to update an existing Wepa user
POST https://api.wepanow.com/resources/users/update/jtest@myuniversity.edu HTTP/1.1

Authorization: Bearer uceef192-04c6-4603-afcf-9463ed66135f 
Content-Type: application/x-www-form-urlencoded 

username=jtest@myuniversity.edu 
current_password=oldpass 
new_password=mysecret 
reset_hash=9438fj39849f83 
groupId=4  
firstName=John  
lastName=Test
userType=1
billingId=2

User Detailshttps://api.wepanow.com/resources/users/user

  • GET

Information about the user tied to the given access token may be obtained with HTTP GET.

Example 2.2 - Retrieving an existing user
GET https://api.wepanow.com/resources/users/user HTTP/1.1

Authorization: Bearer kd84hj49-04c6-4603-afcf-1463ed66135f

Whether creating new users or requesting details about current ones, the response is the same. A user representation is produced and returned in JSON format.

The official content type returned is application/json , and will typically result in an HTTP 200 OK status. In the event an error occurs or the request is invalid (e.g. user does not exist), an appropriate HTTP response will result. See HTTP Response Codes for more info.

Example 2.3 - User created in example 2.1, after he made a few deposits
{ 
   “id” : 23, 
   "username" : “jtest@myuniversity.edu”, 
   “firstName” : “John”, 
   “lastName” : “Test”, 
   “groupId” : 4, 
   “groupDescription” : “WEPA - Default Group”,
   “accountBalance” : 23.34,
   “wepaCurrentBalance” : 20.00,
   “virtualPurseAvailableBalance” : 3.34,
   “studentCardId” : null,
   “md5Tag” : null 
} 

Virtual Fundshttps://api.wepanow.com/resources/users/user/{username}/load

  • POST

In some cases a school or university may make an arrangement with Wepa to have print credits loaded to each user account of the school. These "virtual-loads" are treated just like a student's own funds, and are billed monthly to the school for payment.

Although most funds are applied automatically at the time a user initially logs in to Wepa, schools do have the option to load funds directly at their own discretion and timing. Through Wepa API, clients with certain privileges can load funds to a specific user account by passing a username, amount, start and end dates, and whether or not to reset or add-to the user's current virtual balance. If a user does not currently exist, an account is created for them automatically.

Example 2.3 - Loading a user account with virtual funds
POST https://api.wepanow.com/resources/users/user/joe@umd.edu/load HTTP/1.1

Authorization: Bearer kd84hj49-04c6-4603-afcf-1463ed66135f
Content-Type: application/x-www-form-urlencoded

startDate = 20130101
endDate = 20131231
amount = 50.00 
resetPurse = true

Following is a table of all virtual load parameters.

API User Load - Form Parameters
Name Type Possible Values Default
startDate string {yyyyMMDD (formatted string)}
endDate string {yyyyMMDD (formatted string)}
amount decimal {any currency value}
resetPurse string true, false false