API-Protocol.txt 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533
  1. The following is a description of the proposed protocol for communication between the Client Web Server and the Back End DataBase.
  2. Optional items are enclosed in []'s, Manditory items are in ()'s, Alternative options are seperated by a |.
  3. <string> represents an arbitrary string (i.e. 'Abc Def'), <#> a number (i.e. '1234'), <date> a Date Time (i.e. '2004-01-01 15:33:01').
  4. Characters preceded by a \ are meant as a literal (i.e. \[ is meant as the '[' character). All field items must be less than 256 characters.
  5. The only time this notation is abused is for requests that return multiple (variable number) of items, such as the GetPassesOnCard and GetCard functions.
  6. When there is more than one item being returned, additional fields will have a [<i>] suffix, where <i> denotes the i'th item, starting at 1 from from the first
  7. item using the [<i>] notation. The order in which they are returned is arbitrary but fixed.
  8. example:
  9. A GetCard is sent, the following might be returned if there are 3 cards associated with the account:
  10. Response=success
  11. MagStripe=12345678
  12. RFSite=0
  13. RFID=0
  14. Comment=test card
  15. LastUsed=2010-01-01
  16. FirstUsed=
  17. Issued=2010-01-01
  18. NCard=3
  19. MagStripe[1]=12345679
  20. RFSite[1]=0
  21. RFID[1]=0
  22. Comment[1]=test card
  23. LastUsed[1]=2010-01-01
  24. FirstUsed[1]=
  25. Issued[1]=2010-01-01
  26. MagStripe[2]=12345679
  27. RFSite[2]=0
  28. RFID[2]=0
  29. Comment[2]=test card
  30. LastUsed[2]=2010-01-01
  31. FirstUsed[2]=
  32. Issued[2]=2010-01-01
  33. A client wishing to make a transaction must send an initiate request and take the UserToken and ServerToken returned to create a TransactionToken and ServerTransactionToken respectively.
  34. The TransactionToken and ServerTransactionToken can only be used once per transaction.
  35. '-->' denote messages FROM the (web) client TO the (db) server.
  36. '<--' denote messages TO the (web) client FROM the (db) server.
  37. Transaction Initiation Request
  38. ------------------------------
  39. -->
  40. MessageType=initiate
  41. <--
  42. (
  43. Response=fail
  44. [Reason=<string>] |
  45. Response=success
  46. [Reason=<string>]
  47. UserToken=<string>
  48. ServerToken=<string>
  49. HashAlgorithm=(md5|sha1)
  50. )
  51. Broadly speaking, there are two types of functions, 'user' functions and
  52. 'admin' functions, where the latter has a prefix of 'Admin' as can be seen
  53. below in the function list.
  54. Function List
  55. -------------
  56. AddUser
  57. GetUser
  58. SetUser
  59. GetCard
  60. GetCards
  61. AddCard
  62. RemoveCard
  63. RemovePass
  64. GetPassesOnCard
  65. GetPass
  66. TransferPass
  67. AddPass
  68. SendEmailVerification
  69. SendEmailPasswordReset
  70. PasswordReset
  71. Log
  72. GetCardPricePoints
  73. AdminGetCard
  74. AdminGetCards
  75. AdminGetPass
  76. AdminGetUser
  77. AdminGetAdmin
  78. AdminGetPassesOnCard
  79. AdminGetPendingQueue
  80. AdminProcessPendingQueue
  81. AdminRemovePendingQueue
  82. AdminCreateCardBlock
  83. AdminCreateCard
  84. AdminSetUser
  85. AdminSetAdmin
  86. AdminAddPass
  87. AdminAddCard
  88. AdminAddUser
  89. AdminAddAdmin
  90. AdminRemovePass
  91. AdminRemovePasses
  92. AdminRemoveCard
  93. AdminRemoveUser
  94. AdminRemoveAdmin
  95. AdminTransferCard
  96. AdminTransferPass
  97. AdminGetPassOptions
  98. AdminAddCardToUser
  99. AdminRemoveCardFromUser
  100. AdminGetAdminPermissions
  101. AdminAddAdminPermissions
  102. AdminRemoveAdminPermissions
  103. AdminAddAdminApiPermissions
  104. AdminRemoveAdminApiPermissions
  105. AdminSetAdminApiPermissions
  106. AdminGetCustomCard
  107. AdminGetAdmins
  108. AdminSearchCards
  109. AdminSearchUsers
  110. AdminSearchAdmins
  111. Transaction Requests
  112. -------------------
  113. -->
  114. MessageType=request
  115. Function=(AddUser|GetUser|SetUser|GetCard|GetCards|AddCard|RemoveCard|RemovePass|GetPassesOnCard|GetPass|TransferPass|AddPass|SendEmailVerification|SendEmailPasswordReset|PasswordReset|Log|GetCardPricePoints)
  116. TransactionToken=<string>
  117. ServerTransactionToken=<string>
  118. <FUNCTION PAYLOAD>
  119. <--
  120. Response=(sucess|fail)
  121. [Reason=<string>]
  122. <RESPONSE PAYLOAD>
  123. Comments:
  124. A client wishing to make a transaction/request must first send a POST message to the server with the MessageType set to 'initiate'.
  125. After receiving the UserToken, ServerToken and HashAlgorithm, the client must send back a ServerToken created from hashing the string
  126. produced by concatenating the ServePassword and the ServerToken. i.e. ServerTransactionToken = hash( ServerPassword + ServerToken ).
  127. The ServerPassword is the password shared by the two parties at the endpoints
  128. of the API.
  129. If the function is not one of 'AddUser', 'SendEmailVerification', 'SendEmailPasswordReset', 'PasswordReset' or 'Log', then the TransactionToken
  130. must also be provided. The TransactionToken is created from the hash of the
  131. user's password as its stored in the database concatenated with the
  132. UserToken. i.e. TransactionToken = hash( hash(UserPassword) + UserToken ) if
  133. the function is a user function. If the Function is an admin function, then
  134. the TransactionToken is created from teh hash of the admin's password as it is
  135. stored in the database concatenated with the UserToken. i.e. TransactionToken
  136. = hash( hash(AdminPassword) + UserToken ).
  137. The Transaction Token and Server Transaction Token
  138. will only be valid for 2 minutes after the 'initiate' request. The Transaction Token and Server Transaction Token cannot be re-used after
  139. a transaction that has successfully iliicited a response (either 'success' or 'fail'). Any new request must go through another challenge response (request a token
  140. through an 'initiate', then provide a valid session token).
  141. SHORTHANDS
  142. ----------
  143. Here are some commonly used shorthands:
  144. CARD_CREDENTIAL=
  145. (
  146. CardId=<#> |
  147. (
  148. (MagTrack=<#>)
  149. MagStripe=<#> |
  150. MagToken=<string>
  151. ) |
  152. (
  153. [RFSite=<#>]
  154. RFID=<#> |
  155. RFIDToken=<string>
  156. ) |
  157. (
  158. (
  159. (MagTrack=<#>)
  160. MagStripe=<#> |
  161. MagToken=<string>
  162. )
  163. (
  164. [RFSite=<#>]
  165. RFID=<#> |
  166. RFIDToken=<string>
  167. )
  168. )
  169. )
  170. USER_CREDENTIAL=
  171. (
  172. UserId=<#> |
  173. UserName=<string>
  174. )
  175. ADMIN_CREDENTIAL=
  176. (
  177. AdminUserId=<#> |
  178. AdminUserName=<string>
  179. )
  180. GROUP_CREDENTIAL=
  181. (
  182. GroupId=<#> |
  183. GroupName=<string>
  184. )
  185. For example, the card credential can consist of a CardId or a
  186. MagStripe/MagToken, or a RFID/RFIDToken or a combination of
  187. MagStripe/MagToken and RFID/RFIDToken.
  188. ADMIN_CREDENTIAL and USER_CREDENTIAL are the same but will look up their
  189. values in different tables depending on context and are provided for clarity.
  190. UserId will lookup the id in the admins table for admin functions whereas UserId will lookup
  191. userid in the users table for user functions.
  192. ACL
  193. ---
  194. All functions are under an access control list. All requests are checked
  195. for proper access and will be denied execution if the requesting user or admin
  196. does not have proper permissions. All subsequent create, read, update or
  197. delete (crud) requests will fail if the user or admin does not have access to
  198. the appropriate table.
  199. ACL tables are currently rlapi_aros, rlapi_acos and rlapi_aros_acos.
  200. FUNCTIONS
  201. ---------
  202. AddUser
  203. -------
  204. -->
  205. MessageType=request
  206. Function=AddUser
  207. ServerTransactionToken=<string>
  208. UserName=<username>
  209. PasswordHash=<string>
  210. RegistrationToken=<string>
  211. [Firstname=<string>]
  212. [Lastname=<string>]
  213. [Phone=<string>]
  214. [Email=<string>]
  215. [Address=<string>]
  216. [City=<string>]
  217. [State=<string>]
  218. [ZIP=<string>]
  219. [ShippingFirstname=<string>]
  220. [ShippingLastname=<string>]
  221. [ShippingAddress=<string>]
  222. [ShippingCity=<string>]
  223. [ShippingState=<string>]
  224. [ShippingZIP=<string>]
  225. [Comment=<string>]
  226. <--
  227. (
  228. Response=fail
  229. [Reason=<string>] |
  230. Response=success
  231. [Reason=<string>]
  232. UserId=<#>
  233. )
  234. Comments:
  235. The request will fail if the UserName already exists.
  236. The RegistrationToken must be from a SendEmailVerification request.
  237. The RegistrationToken will only be valid for 1 day after the registration
  238. request has been initiated.
  239. GetUser
  240. -------
  241. -->
  242. MessageType=request
  243. Function=GetUser
  244. TransactionToken=<string>
  245. ServerTransactionToken=<string>
  246. (
  247. UserId=<#> |
  248. UserName=<string>
  249. )
  250. <--
  251. (
  252. Response=fail
  253. [Reason=<string>] |
  254. Response=success
  255. [Reason=<string>]
  256. UserId=<#>
  257. UserName=<string>
  258. FirstName=<string>
  259. LastName=<string>
  260. Phone=<string>
  261. Email=<string>
  262. Address=<string>
  263. City=<string>
  264. State=<string>
  265. ZIP=<string>
  266. Comment=<string>
  267. )
  268. Comments:
  269. SetUser
  270. -------
  271. -->
  272. MessageType=request
  273. Function=SetUser
  274. TransactionToken=<string>
  275. ServerTransactionToken=<string>
  276. (
  277. UserId=<#> |
  278. UserName=<string>
  279. )
  280. [PasswordHash=<string>]
  281. [FirstName=<string>]
  282. [LastName=<string>]
  283. [Phone=<string>]
  284. [Email=<string>]
  285. [Address=<string>]
  286. [City=<string>]
  287. [State=<string>]
  288. [ZIP=<string>]
  289. [ShippingFirstname=<string>]
  290. [ShippingLastname=<string>]
  291. [ShippingAddress=<string>]
  292. [ShippingCity=<string>]
  293. [ShippingState=<string>]
  294. [ShippingZIP=<string>]
  295. [Comment=<string>]
  296. <--
  297. Response=(success|fail)
  298. [Reason=<string>]
  299. Comments:
  300. PasswordHash is the sha1 digest of the user specified Password.
  301. GetCard
  302. -------
  303. -->
  304. MessageType=request
  305. Function=GetCard
  306. TransactionToken=<string>
  307. ServerTransactionToken=<string>
  308. (
  309. UserId=<#> |
  310. UserName=<string>
  311. )
  312. (
  313. MagStripe=<string> |
  314. [RFSite=<#>]
  315. RFID=<#> |
  316. CardId=<#>
  317. )
  318. <--
  319. Response=fail
  320. [Reason=<string>] |
  321. Response=success
  322. [Reason=<string>]
  323. MagStripe=(<#>|)
  324. RFSite=(<#>|)
  325. RFID=(<#>|)
  326. CardId=<#>
  327. Comment=<string>
  328. LastUsed=<string>
  329. Issued=<date>
  330. FirstUsed=<date>
  331. Comments:
  332. GetCards
  333. -------
  334. -->
  335. MessageType=request
  336. Function=GetCards
  337. TransactionToken=<string>
  338. ServerTransactionToken=<string>
  339. (
  340. UserId=<#> |
  341. UserName=<string>
  342. )
  343. [MaxCard=<#>]
  344. <--
  345. (
  346. Response=fail
  347. [Reason=<string>] |
  348. Response=success
  349. [Reason=<string>]
  350. NCard=<#>
  351. [
  352. MagStripe=(<#>|)
  353. RFSite=(<#>|)
  354. RFID=(<#>|)
  355. CardId=<#>
  356. Comment=<string>
  357. LastUsed=<string>
  358. Issued=<date>
  359. FirstUsed=<date>
  360. ]
  361. [(
  362. MagStripe\[<i>\]=(<#>|)
  363. RFSite\[<i>\]=(<#>|)
  364. RFID\[<i>\]=(<#>|)
  365. CardId\[<i>\]=<#>
  366. Comment\[<i\]=<string>
  367. LastUsed\[<i\]=<date>
  368. Issued\[<i>\]=<date>
  369. FirstUsed\[<i>\]=<date>
  370. ){<ncard-1>}]
  371. )
  372. Comments:
  373. If there is more than one card associated with the supplied user, NCard will be set and
  374. there will be NCard-1 extra MagStripe, RFSite, RFID, Comment, LastUsed, Issued and FirstUsed
  375. field items, indexed by [<i>], starting at 1.
  376. If the MaxCard field is set in the Client to Server request, no more than MaxCard number of
  377. Cards will be returned (NCard <= MaxCard).
  378. AddCard
  379. -------
  380. -->
  381. MessageType=request
  382. Function=AddCard
  383. TransactionToken=<string>
  384. ServerTransactionToken=<string>
  385. (
  386. UserId=<#> |
  387. UserName=<string>
  388. )
  389. (
  390. MagStripe=(<#>|) |
  391. [RFSite=<#>]
  392. RFID=<#> |
  393. MagStripe=<#>
  394. [RFSite=<#>]
  395. RFID=<#> |
  396. Issue=(fob|rfidsticker|magstripe)
  397. )
  398. [Type=<string>]
  399. [Comment=<string>]
  400. <--
  401. Response=(success|fail)
  402. [Reason=<string>]
  403. CardId=<#>
  404. Comments:
  405. The request will fail if the user tries to add a pre-existing card.
  406. If RFSite is not specified, a default value will be used.
  407. If Issue is set, an 'anonymous' card will be created that does not have
  408. magstripe or rfsite/rfid credential information set and must be accessed
  409. by its cardid. On the back-end, this will generate a re-issue request whereby
  410. a card will be shipped to the users shipping address and the appropriate
  411. credential information will be filled in depending on what type of re-issue
  412. request (magsripe for a magstripe request, rfsite/rfid for a fob/rfidsticker
  413. request) by the person fulfilling the re-issue request.
  414. Type can be used as an extra field as an indicator for any special actions
  415. or operations that need to be be performed when adding a card to the account.
  416. i.e. that the MagStripe is really the
  417. student id and one needs to do a fuzzy match to add the card to the students
  418. account.
  419. RemoveCard
  420. ----------
  421. -->
  422. MessageType=request
  423. Function=RemoveCard
  424. TransactionToken=<string>
  425. ServerTransactionToken=<string>
  426. (
  427. UserId=<#> |
  428. UserName=<string>
  429. )
  430. (
  431. MagStripe=<#> |
  432. [RFSite=<#>]
  433. RFID=<#> |
  434. CardId=<#>
  435. )
  436. <--
  437. Response=(success|fail)
  438. [Reason=<string>]
  439. Comments:
  440. The request will fail if the user does not own a card with the specified
  441. credentials or if there are any passes on the card. One may only remove
  442. a card with no non-expired passes.
  443. If RFSite is not specified, a default value will be used.
  444. RemovePass
  445. ----------
  446. -->
  447. MessageType=request
  448. Function=RemovePass
  449. TransactionToken=<string>
  450. ServerTransactionToken=<string>
  451. (
  452. UserId=<#> |
  453. UserName=<string>
  454. )
  455. (
  456. MagStripe=<#> |
  457. [RFSite=<#>]
  458. RFID=<#> |
  459. CardId=<#>
  460. )
  461. PassId=<#>
  462. <--
  463. Response=(success|fail)
  464. [Reason=<string>]
  465. Comments:
  466. Remove a pass assicated with a card.
  467. If RFSite is not specified, a default value will be used.
  468. GetPassesOnCard
  469. ---------------
  470. -->
  471. MessageType=request
  472. Function=GetPassesOnCard
  473. TransactionToken=<string>
  474. ServerTransactionToken=<string>
  475. (
  476. UserId=<#> |
  477. UserName=<string>
  478. )
  479. (
  480. MagStripe=<#> |
  481. [RFSite=<#>]
  482. RFID=<#> |
  483. CardId=<#>
  484. )
  485. <--
  486. (
  487. Response=fail
  488. [Reason=<string>] |
  489. Response=success
  490. [Reason=<string>]
  491. NPass=<#>
  492. [
  493. PassId=<#>
  494. Active=<#>
  495. Comment=<string>
  496. LastUsed=<date>
  497. Issued=<date>
  498. FirstUsed=<date>
  499. Type=(nday|nride|preactive|<company card>)
  500. QueueOrder=<#>
  501. Comment=<string>
  502. NRideOrig=(<#>|)
  503. NRideRemain=(<#>|)
  504. NDayOrig=(<#>|)
  505. NDayExpiration=(<date>|)
  506. PayType=(cash|credit)
  507. ]
  508. [(
  509. PassId\[<i>\]=<#>
  510. Active\[<i>\]=<#>
  511. Comment\[<i>\]=<string>
  512. LastUsed\[<i>\]=<date>
  513. Issued\[<i>\]=<date>
  514. FirstUsed\[<i>\]=<date>
  515. Type\[<i>\]=(nday|nride|preactive|<company card>)
  516. QueueOrder\[<i>\]=<#>
  517. Comment\[<i>\]=<string>
  518. NRideOrig\[<i>\]=(<#>|)
  519. NRideRemain\[<i>\]=(<#>|)
  520. NDayOrig\[<i>\]=(<#>|)
  521. NDayExpiration\[<i>\]=(<date>|)
  522. PayType\[<i>\]=(cash|credit)
  523. ){<NPass-1>}]
  524. )
  525. Comments:
  526. If there are multiple passes associated with the supplied card, NPass will be set and there will
  527. be NPass-1 extra PassId, Comment, LastUsed, Issued, FirstUsed, Type, QueueOrder, Comment, NRideOrig, NrideRemain,
  528. NDayOrig and NDayExpiration, indexed by [<i>], starting at 1.
  529. If RFSite is not specified, a default value will be used.
  530. GetPass
  531. -------
  532. -->
  533. MessageType=request
  534. Function=GetPass
  535. TransactionToken=<string>
  536. ServerTransactionToken=<string>
  537. (
  538. UserId=<#> |
  539. UserName=<string>
  540. )
  541. PassId=<#>
  542. <--
  543. (
  544. Response=fail
  545. [Reason=<string>] |
  546. Response=success
  547. [Reason=<string>]
  548. Active=<#>
  549. Issued=<date>
  550. FirstUsed=<date>
  551. LastUsed=<date>
  552. Type=(nday|nride|preactive|<company card>)
  553. QueueOrder=<#>
  554. Comment=<string>
  555. NRideOrig=(<#>|)
  556. NRideRemain=(<#>|)
  557. NDayOrig=(<#>|)
  558. NDayExpiration=(<date>|)
  559. PayType=(cash|credit)
  560. )
  561. Comment:
  562. The request will fail if the PassId is not associated with the user.
  563. TransferPass
  564. ------------
  565. -->
  566. MessageType=request
  567. Function=TransferPass
  568. TransactionToken=<string>
  569. ServerTransactionToken=<string>
  570. (
  571. UserId=<#> |
  572. UserName=<string>
  573. )
  574. PassId=<#>
  575. (
  576. ToMagStripe=<#> |
  577. [ToRFSite=<#>]
  578. ToRFID=<#> |
  579. ToCardId=<#>
  580. )
  581. <--
  582. Response=(success|fail)
  583. [Reason=<string>]
  584. Comments:
  585. The request will fail if the To credential is taken or invalid.
  586. If ToRFSite is not specified, a default value will be used.
  587. Depending on permissions on the Server, the request might fail even if the
  588. user provides a valid To credential.
  589. AddPass
  590. -------
  591. -->
  592. MessageType=request
  593. Function=AddPass
  594. TransactionToken=<string>
  595. ServerTransactionToken=<string>
  596. (
  597. UserId=<#> |
  598. UserName=<string>
  599. )
  600. (
  601. MagStripe=<#> |
  602. [RFSite=<#>]
  603. RFID=<#> |
  604. CardId=<#>
  605. )
  606. Comment=<string>
  607. (
  608. Type=<string> |
  609. Type=<nride-type>
  610. NRide=<#> |
  611. Type=<nday-type>
  612. NDay=<#>
  613. [Expiration=<date>]
  614. )
  615. [Quantity=<#>]
  616. [(PaymentType=cash
  617. PaymentAmount=<#> |
  618. PaymentType=credit
  619. AuthorizationCode=<string>
  620. PaymentAmount=<#>)]
  621. <--
  622. (
  623. Response=fail
  624. [Reason=<string>]
  625. Response=success |
  626. [Reason=<string>]
  627. PassId=<#>
  628. [(PassId[<#>]=<#>]){<Quantity-1>}]
  629. )
  630. Comment:
  631. If RFSite is not specified, a default value will be used.
  632. Type must be one of the card types. currently supported types are:
  633. <nday-type>:
  634. NDAYAC, N-day All County
  635. NDAYTC, N-day Gov County
  636. NDAYYSS(\d\d), N-day Youth Semester Spring for year 20XX
  637. NDAYYSF(\d\d), N-day Youth Semester Fall for year 20XX
  638. NDAYSF(\d\d), N-Day Summer Fun for year 20XX
  639. <nride-type>:
  640. NRIDEACA, N-Ride All County Adult
  641. NRIDEACH, N-Ride All County Half
  642. NRIDEACY, N-Ride All County Youth
  643. NRIDETCA, N-Ride Gov County Adult
  644. NRIDETCH, N-Ride Gov County Half
  645. NRIDETCY, N-Ride Gov County Youth
  646. If type is not nday or nride, it must be a billing domain.
  647. If type is set and not 'cash', AuthorizationCode should be the Authorization Code of the
  648. transaction.
  649. Quantity number of passes will be created. Quantity assumed to be 1 if none specified.
  650. The PassId (and PassId[<#>] where appropriate) will contain the pass id's of
  651. the newly inserted passes. The PassId and indicies into the PassId array are
  652. _for this function only_ and do not reflect what indicies will be returned via
  653. a call to any of the other functions (GetPassesOnCard etc.).
  654. SendEmailVerification
  655. ----------------------
  656. -->
  657. MessageType=request
  658. Function=SendEmailVerification
  659. ServerTransactionToken=<string>
  660. RedirectURL=<string>
  661. Email=<string>
  662. <--
  663. (
  664. Response=fail
  665. [Reason=<string>]
  666. Response=success |
  667. [Reason=<string>]
  668. )
  669. Comment:
  670. Send an email to specified email address with a link back to the redirect
  671. url with the following variables set:
  672. action=register
  673. registrationtoken=<token>
  674. The registration token must be given to the add user for it to successfully
  675. complete.
  676. The RegistrationToken will only be valid for 1 day after the registration
  677. request has been initiated.
  678. SendEmailPasswordReset
  679. ----------------------
  680. -->
  681. MessageType=request
  682. Function=SendEmailPasswordReset
  683. ServerTransactionToken=<string>
  684. UserName=<string>
  685. RedirectURL=<string>
  686. Email=<string>
  687. <--
  688. (
  689. Response=fail
  690. [Reason=<string>]
  691. Response=success |
  692. [Reason=<string>]
  693. )
  694. Comment:
  695. Send an email with a link back to the RedirectURL. The following variables
  696. will appear in the link back to the RedirectURL:
  697. action=password_reset
  698. username=<string>
  699. passwordresettoken=<string>
  700. The token must be provided to the PasswordReset for it to successfully
  701. complete.
  702. The option to reset a password will only be valid for 2 days after
  703. the reset request has been sent.
  704. A maximum of 3 SendEmailPasswordReset attempts may be made before a
  705. successful login or a successful PasswordReset request has completed.
  706. PasswordReset
  707. -------------
  708. -->
  709. MessageType=request
  710. Function=PasswordReset
  711. ServerTransactionToken=<string>
  712. PasswordResetToken=<string>
  713. PasswordHash=<string>
  714. <--
  715. (
  716. Response=fail
  717. [Reason=<string>]
  718. Response=success |
  719. [Reason=<string>]
  720. )
  721. Comment:
  722. PasswordResetToken must be the result of a password reset request
  723. (SendEmailPasswordReset). The PasswordReset request will fail if
  724. the PasswordResetToken is not the most recent active PasswordResetToken.
  725. A PasswordResetToken will be inactivated upon a new PasswordResetToken
  726. generation for a particular user or if the timeout has expired (2 days in this
  727. case).
  728. Assuming that the PasswordResetToken is
  729. set to the most recent SendEmailPasswordReset request, then the
  730. user's password hash will be set to PasswordHash. The user will be
  731. the same as the UserName specified in the SendEmailPasswordReset.
  732. The option to reset a password will only be valid for 2 days after
  733. the reset request has been sent.
  734. Log
  735. ---
  736. -->
  737. MessageType=request
  738. Function=Log
  739. ServerTransactionToken=<string>
  740. Log=<string>
  741. <--
  742. (
  743. Response=fail
  744. [Reason=<string>]
  745. Response=success |
  746. [Reason=<string>]
  747. )
  748. Comment:
  749. Put the string of text specified in Log into an internal log.
  750. GetCardPricePoints
  751. ------------------
  752. -->
  753. MessageType=request
  754. Function=GetCardPricePoints
  755. TransactionToken=<string>
  756. ServerTransactionToken=<string>
  757. (
  758. UserId=<#> |
  759. UserName=<string>
  760. )
  761. PasswordHash=<string>
  762. [
  763. MagStripe=<#> |
  764. [RFSite=<#>]
  765. RFID=<#> |
  766. CardId=<#>
  767. ]
  768. Comment=<string>
  769. <--
  770. (
  771. Response=fail
  772. [Reason=<string>] |
  773. Response=success
  774. [Reason=<string>]
  775. NPricePoint=<#>
  776. GroupName=<string>
  777. GroupId=<string>
  778. (
  779. Price=<#>|<#.#>
  780. Param=<#>
  781. Name=<string>
  782. Rule=<string>
  783. Type=<string>
  784. Description=<string>
  785. NumPriceOption=<#>
  786. PriceOption0=<string>
  787. PriceOption1=<string>
  788. PriceOption2=<string>
  789. PriceOption3=<string>
  790. [(
  791. Price=<#>|<#.#>
  792. Param=<#>
  793. Name=<string>
  794. Rule=<string>
  795. Type=<string>
  796. Description=<string>
  797. NumPriceOption=<#>
  798. PriceOption0=<string>
  799. PriceOption1=<string>
  800. PriceOption2=<string>
  801. PriceOption3=<string>
  802. ){<NPricePoint>-1}]
  803. )
  804. )
  805. Comment:
  806. Returns a list of price points for a given card, restricted to the price
  807. points available for that card (e.g. it's group).
  808. Price is in dollars
  809. Param is the number of rides for an NRide type, the number of days for an
  810. NDay type and blank for an other type.
  811. Name is an identifier. The current convention is to have the rule without
  812. the preceeding groupname if it's an other. If it's an NRide or NDay, the form
  813. is:
  814. ORG\.(NRIDE|NDAY)\.ZON([12])\.([AHY])\.(\d+)
  815. where $1 is 'NRIDE' or 'NDAY' depending on which type it is, $2 is 1 or 2
  816. depending on which zone it is, $3 is A for adult, H for half, Y for youth and
  817. $4 is the parameter.
  818. Rule is the database rule without group name prefix
  819. Type is other, nride or nday
  820. Description is a string description of the pass type
  821. NumPriceOption is the number of PriceOption[0123] to use
  822. PriceOption[0123] are strings meant to help the web site build it's drop
  823. down of options. Currently the convention is:
  824. NDAY: PriceOption0 is the zone identifier (e.g. 'Zone 1', 'Zone 2')
  825. PriceOption1 is the nday identifier (e.g. 'Single', 'Double', 'Month')
  826. NRide: PriceOption0 is the zone identifier
  827. PriceOption1 is the nride identifier
  828. PriceOption2 is the quantity identifier
  829. Other: PriceOption0 is the pass description (e.g. 'Semester Spring (k-12, 2012, Zone1)')
  830. ADMIN FUNCTIONS
  831. ---------------
  832. AdminGetCard
  833. ------------
  834. -->
  835. MessageType=request
  836. Function=AdminGetCard
  837. TransactionToken=<string>
  838. ServerTransactionToken=<string>
  839. ADMIN_CREDENTIAL
  840. CARD_CREDENTIAL
  841. <--
  842. (
  843. Response=fail
  844. [Reason=<string>] |
  845. Response=success
  846. [Reason=<string>]
  847. MagStripe=(<#>|)
  848. RFSite=(<#>|)
  849. RFID=(<#>|)
  850. CardId=<#>
  851. Comment=<string>
  852. LastUsed=<string>
  853. Issued=<date>
  854. FirstUsed=<date>
  855. )
  856. Comments:
  857. AdminGetCards
  858. -------------
  859. -->
  860. MessageType=request
  861. Function=AdminGetCards
  862. TransactionToken=<string>
  863. ServerTransactionToken=<string>
  864. ADMIN_CREDENTIAL
  865. USER_CREDENTIAL
  866. <--
  867. (
  868. Response=fail
  869. [Reason=<string>] |
  870. Response=success
  871. [Reason=<string>]
  872. NCard=<#>
  873. [
  874. MagStripe=(<#>|)
  875. RFSite=(<#>|)
  876. RFID=(<#>|)
  877. CardId=<#>
  878. Comment=<string>
  879. LastUsed=<string>
  880. Issued=<date>
  881. FirstUsed=<date>
  882. ]
  883. [(
  884. MagStripe\[<i>\]=(<#>|)
  885. RFSite\[<i>\]=(<#>|)
  886. RFID\[<i>\]=(<#>|)
  887. CardId\[<i>\]=<#>
  888. Comment\[<i\]=<string>
  889. LastUsed\[<i\]=<date>
  890. Issued\[<i>\]=<date>
  891. FirstUsed\[<i>\]=<date>
  892. ){<ncard-1>}]
  893. )
  894. Comments:
  895. If there is more than one card associated with the supplied user, NCard will
  896. be set and there will be NCard-1 extra MagStripe, RFSite, RFID, Comment,
  897. LastUsed, Issued and FirstUsed field items, indexed by [<i>], starting at 1.
  898. If the MaxCard field is set in the Client to Server request, no more than
  899. MaxCard number of Cards will be returned (NCard <= MaxCard).
  900. AdminGetPass
  901. -------------
  902. -->
  903. MessageType=request
  904. Function=AdminGetPass
  905. TransactionToken=<string>
  906. ServerTransactionToken=<string>
  907. CardId=<#>
  908. PassId=<#>
  909. [UserId=<#>]
  910. [Active=[01]]
  911. <--
  912. (
  913. Response=fail
  914. [Reason=<string>] |
  915. Response=success
  916. [Reason=<string>]
  917. Type=<string>
  918. PassId=<#>
  919. CardId=<#>
  920. Issued=<date>
  921. FirstUsed=<date>
  922. LastUsed=<date>
  923. Deactivated=<date>
  924. Rule=<string>
  925. NRideOrig=<#>
  926. NRideRemain=<#>
  927. NDayOrig=<#>
  928. NDayExpiration=<date>
  929. QueueOrder=<#>
  930. Comment=<string>
  931. Active=[01]
  932. Expired=<date>
  933. PaymentType=<string>
  934. Comment=<string>
  935. Comments:
  936. AdminGetAdmin
  937. -------------
  938. -->
  939. MessageType=request
  940. Function=AdminGetAdmin
  941. TransactionToken=<string>
  942. ServerTransactionToken=<string>
  943. ADMIN_CREDENTIAL
  944. USER_CREDENTIAL
  945. <--
  946. (
  947. Response=fail
  948. [Reason=<string>] |
  949. Response=success
  950. [Reason=<string>]
  951. Comments:
  952. User here is an admin user and will look up the appropriate fields in the
  953. admins table, not the users table.
  954. AdminGetPassesOnCard
  955. -------------
  956. -->
  957. MessageType=request
  958. Function=AdminGetAdmin
  959. TransactionToken=<string>
  960. ServerTransactionToken=<string>
  961. ADMIN_CREDENTIAL
  962. CARD_CREDENTIAL
  963. <--
  964. (
  965. Response=fail
  966. [Reason=<string>] |
  967. Response=success
  968. [Reason=<string>]
  969. NPass=<#>
  970. [
  971. PassId=<#>
  972. Active=<#>
  973. Comment=<string>
  974. LastUsed=<date>
  975. Issued=<date>
  976. FirstUsed=<date>
  977. Type=(nday|nride|preactive|<company card>)
  978. QueueOrder=<#>
  979. Comment=<string>
  980. NRideOrig=(<#>|)
  981. NRideRemain=(<#>|)
  982. NDayOrig=(<#>|)
  983. NDayExpiration=(<date>|)
  984. PayType=(cash|credit)
  985. ]
  986. [(
  987. PassId\[<i>\]=<#>
  988. Active\[<i>\]=<#>
  989. Comment\[<i>\]=<string>
  990. LastUsed\[<i>\]=<date>
  991. Issued\[<i>\]=<date>
  992. FirstUsed\[<i>\]=<date>
  993. Type\[<i>\]=(nday|nride|preactive|<company card>)
  994. QueueOrder\[<i>\]=<#>
  995. Comment\[<i>\]=<string>
  996. NRideOrig\[<i>\]=(<#>|)
  997. NRideRemain\[<i>\]=(<#>|)
  998. NDayOrig\[<i>\]=(<#>|)
  999. NDayExpiration\[<i>\]=(<date>|)
  1000. PayType\[<i>\]=(cash|credit)
  1001. ){<NPass-1>}]
  1002. )
  1003. Comments:
  1004. AdminGetGetPendingQueue
  1005. -------------
  1006. -->
  1007. MessageType=request
  1008. Function=AdminGetAdmin
  1009. TransactionToken=<string>
  1010. ServerTransactionToken=<string>
  1011. ADMIN_CREDENTIAL
  1012. <--
  1013. (
  1014. Response=fail
  1015. [Reason=<string>] |
  1016. Response=success
  1017. [Reason=<string>]
  1018. NCard=<#>
  1019. [
  1020. CardId=<#>
  1021. Created=<date>
  1022. IssueType=<string>
  1023. UserId=<#>
  1024. [(
  1025. CardId\[<i>\]=<#>
  1026. Created\[<i>\]=<date>
  1027. IssueType\[<i>\]=<string>
  1028. UserId\[<i>\]=<#>
  1029. ){<NPass-2>}]
  1030. ]
  1031. Comments:
  1032. AdminCreateCard
  1033. ---------------
  1034. -->
  1035. MessageType=request
  1036. Function=AdminCreateCard
  1037. TransactionToken=<string>
  1038. ServerTransactionToken=<string>
  1039. ADMIN_CREDENTIAL
  1040. USER_CREDENTIAL
  1041. CARD_CREDENTIAL
  1042. [IssueType=<string>]
  1043. [LastUsed=<date>}
  1044. [Issued=<date>}
  1045. [FirstUsed=<date>}
  1046. [Deactivated=[01]}
  1047. [Comment=<string>]
  1048. <--
  1049. Response=fail
  1050. [Reason=<string>] |
  1051. Response=success
  1052. [Reason=<string>]
  1053. CardId=<#>
  1054. Comments:
  1055. Create a new user_card entry with the appropriate fields. The default group
  1056. is currently set to 'ORG'. If RFSite is not provided (without a MagToken) but a MagStripe
  1057. is, this will be taken to be the default of the group (taken from the
  1058. org_default_card_value table).
  1059. AdminAddCard
  1060. ------------
  1061. -->
  1062. MessageType=request
  1063. Function=AdminAddCard
  1064. TransactionToken=<string>
  1065. ServerTransactionToken=<string>
  1066. ADMIN_CREDENTIAL
  1067. USER_CREDENTIAL
  1068. CARD_CREDENTIAL
  1069. [Type=<string>]
  1070. [Comment=<string>]
  1071. <--
  1072. Response=(success|fail)
  1073. [Reason=<string>]
  1074. CardId=<#>
  1075. Comments:
  1076. Associates a pre-existing card to a user.
  1077. AdminGetAdmin
  1078. -------------
  1079. -->
  1080. MessageType=request
  1081. Function=AdminGetAdmin
  1082. TransactionToken=<string>
  1083. ServerTransactionToken=<string>
  1084. ADMIN_CREDENTIAL
  1085. USER_CREDENTIAL
  1086. <--
  1087. (
  1088. Response=fail
  1089. [Reason=<string>] |
  1090. Response=success
  1091. [Reason=<string>]
  1092. GroupId=<#>
  1093. GroupName=<string>
  1094. UserId=<#>
  1095. UserName=<#>
  1096. Comments:
  1097. USER_CREDENTIAL refers to the desired admin being looked up
  1098. AdminProcessPendingQueue
  1099. -------------
  1100. -->
  1101. MessageType=request
  1102. Function=AdminProcessPendingQueue
  1103. TransactionToken=<string>
  1104. ServerTransactionToken=<string>
  1105. ADMIN_CREDENTIAL
  1106. QueueId=<#>
  1107. CARD_CREDENTIAL
  1108. <--
  1109. (
  1110. Response=fail
  1111. [Reason=<string>] |
  1112. Response=success
  1113. [Reason=<string>]
  1114. CardId=<#>
  1115. Comments:
  1116. AdminRemovePendingQueue
  1117. -------------
  1118. -->
  1119. MessageType=request
  1120. Function=AdminRemovePendingQueue
  1121. TransactionToken=<string>
  1122. ServerTransactionToken=<string>
  1123. ADMIN_CREDENTIAL
  1124. QueueId=<#>
  1125. <--
  1126. (
  1127. Response=fail
  1128. [Reason=<string>] |
  1129. Response=success
  1130. [Reason=<string>]
  1131. Comments:
  1132. AdminCreateCardBlock
  1133. -------------
  1134. -->
  1135. MessageType=request
  1136. Function=AdminCreateCardBlock
  1137. TransactionToken=<string>
  1138. ServerTransactionToken=<string>
  1139. ADMIN_CREDENTIAL
  1140. CARD_CREDENTIAL
  1141. NCard=<#>
  1142. [PASS_CREDENTIAL]
  1143. <--
  1144. (
  1145. Response=fail
  1146. [Reason=<string>] |
  1147. Response=success
  1148. [Reason=<string>]
  1149. Comments:
  1150. Will add NCard cards in total starting at CARD_CREDENTIAL and incrementing
  1151. the appropriate field (RFID or MagStripe) adding a pass, PASS_CREDENTIAL,
  1152. to each or none if no PASS_CREDENTIAL is specified.
  1153. A hard limit of 1000 is set and requests for more than 1000 at one time will
  1154. fail.
  1155. AdminSetUser
  1156. -------------
  1157. -->
  1158. MessageType=request
  1159. Function=AdminSetUser
  1160. TransactionToken=<string>
  1161. ServerTransactionToken=<string>
  1162. ADMIN_CREDENTIAL
  1163. USER_CREDENTIAL
  1164. [PasswordHash=<string>]
  1165. [FirstName=<string>]
  1166. [LastName=<string>]
  1167. [Phone=<string>]
  1168. [Email=<string>]
  1169. [Address=<string>]
  1170. [City=<string>]
  1171. [State=<string>]
  1172. [ZIP=<string>]
  1173. [ShippingFirstname=<string>]
  1174. [ShippingLastname=<string>]
  1175. [ShippingAddress=<string>]
  1176. [ShippingCity=<string>]
  1177. [ShippingState=<string>]
  1178. [ShippingZIP=<string>]
  1179. [Comment=<string>]
  1180. <--
  1181. (
  1182. Response=fail
  1183. [Reason=<string>] |
  1184. Response=success
  1185. [Reason=<string>]
  1186. UserId=<#>
  1187. Comments:
  1188. AdminSetAdmin
  1189. -------------
  1190. -->
  1191. MessageType=request
  1192. Function=AdminSetAdmin
  1193. TransactionToken=<string>
  1194. ServerTransactionToken=<string>
  1195. ADMIN_CREDENTIAL
  1196. USER_CREDENTIAL
  1197. [PasswordHash=<string>]
  1198. [GroupName=<string>]
  1199. [GroupId=<#>]
  1200. <--
  1201. (
  1202. Response=fail
  1203. [Reason=<string>] |
  1204. Response=success
  1205. [Reason=<string>]
  1206. UserId=<#>
  1207. Comments:
  1208. AdminAddPass
  1209. -------------
  1210. -->
  1211. MessageType=request
  1212. Function=AdminAddPass
  1213. TransactionToken=<string>
  1214. ServerTransactionToken=<string>
  1215. ADMIN_CREDENTIAL
  1216. CARD_CREDENTIAL
  1217. [Comment=<string>]
  1218. (
  1219. Type=<string> |
  1220. Type=<nride-type>
  1221. NRide=<#> |
  1222. Type=<nday-type>
  1223. NDay=<#>
  1224. [Expiration=<date>]
  1225. )
  1226. [Quantity=<#>]
  1227. <--
  1228. (
  1229. Response=fail
  1230. [Reason=<string>] |
  1231. Response=success
  1232. [Reason=<string>]
  1233. PassId=<#>
  1234. [(
  1235. PassId\[<i>\]=<#>
  1236. ){Quantity-1}]
  1237. Comments:
  1238. AdminAddUser
  1239. -------------
  1240. -->
  1241. MessageType=request
  1242. Function=AdminAddUser
  1243. TransactionToken=<string>
  1244. ServerTransactionToken=<string>
  1245. ADMIN_CREDENTIAL
  1246. UserName=<string>
  1247. [PasswordHash=<string>]
  1248. [FirstName=<string>]
  1249. [LastName=<string>]
  1250. [Phone=<string>]
  1251. [Email=<string>]
  1252. [Address=<string>]
  1253. [City=<string>]
  1254. [State=<string>]
  1255. [ZIP=<string>]
  1256. [ShippingFirstname=<string>]
  1257. [ShippingLastname=<string>]
  1258. [ShippingAddress=<string>]
  1259. [ShippingCity=<string>]
  1260. [ShippingState=<string>]
  1261. [ShippingZIP=<string>]
  1262. [Comment=<string>]
  1263. <--
  1264. (
  1265. Response=fail
  1266. [Reason=<string>] |
  1267. Response=success
  1268. [Reason=<string>]
  1269. UserId=<#>
  1270. Comments:
  1271. AdminAddAdmin
  1272. -------------
  1273. -->
  1274. MessageType=request
  1275. Function=AdminAddAdmin
  1276. TransactionToken=<string>
  1277. ServerTransactionToken=<string>
  1278. ADMIN_CREDENTIAL
  1279. UserName=<string>
  1280. PasswordHash=<string>
  1281. [GROUP_CREDENTIAL]
  1282. <--
  1283. (
  1284. Response=fail
  1285. [Reason=<string>] |
  1286. Response=success
  1287. [Reason=<string>]
  1288. UserId=<#>
  1289. Comments:
  1290. AdminRemovePass
  1291. -------------
  1292. -->
  1293. MessageType=request
  1294. Function=AdminRemovePass
  1295. TransactionToken=<string>
  1296. ServerTransactionToken=<string>
  1297. ADMIN_CREDENTIAL
  1298. PassId=<#>
  1299. <--
  1300. (
  1301. Response=fail
  1302. [Reason=<string>] |
  1303. Response=success
  1304. [Reason=<string>]
  1305. Comments:
  1306. Expires pass. If the pass was active it deactivates it. If the pass was activae and
  1307. another unexpired pass exists after it, will activate the next unexpired pass
  1308. in theq queue.
  1309. AdminRemovePasses
  1310. -------------
  1311. -->
  1312. MessageType=request
  1313. Function=AdminRemovePasses
  1314. TransactionToken=<string>
  1315. ServerTransactionToken=<string>
  1316. ADMIN_CREDENTIAL
  1317. NPass=<#>
  1318. PassId=<#>
  1319. [(
  1320. PassId\[<i>\]=<#>
  1321. ){Npass-1}]
  1322. <--
  1323. (
  1324. Response=fail
  1325. [Reason=<string>] |
  1326. Response=success
  1327. [Reason=<string>]
  1328. Comments:
  1329. Same as AdminRemovePass but will deactivate multiple passes at once
  1330. AdminRemoveCard
  1331. -------------
  1332. -->
  1333. MessageType=request
  1334. Function=AdminRemoveCard
  1335. TransactionToken=<string>
  1336. ServerTransactionToken=<string>
  1337. ADMIN_CREDENTIAL
  1338. CARD_CREDENTIAL
  1339. <--
  1340. (
  1341. Response=fail
  1342. [Reason=<string>] |
  1343. Response=success
  1344. [Reason=<string>]
  1345. Comments:
  1346. Deactivates card.
  1347. AdminRemoveUser
  1348. -------------
  1349. -->
  1350. MessageType=request
  1351. Function=AdminRemoveUser
  1352. TransactionToken=<string>
  1353. ServerTransactionToken=<string>
  1354. ADMIN_CREDENTIAL
  1355. USER_CREDENTIAL
  1356. <--
  1357. (
  1358. Response=fail
  1359. [Reason=<string>] |
  1360. Response=success
  1361. [Reason=<string>]
  1362. Comments:
  1363. Deactivates user
  1364. AdminRemoveAdmin
  1365. -------------
  1366. -->
  1367. MessageType=request
  1368. Function=AdminRemoveAdmin
  1369. TransactionToken=<string>
  1370. ServerTransactionToken=<string>
  1371. ADMIN_CREDENTIAL
  1372. USER_CREDENTIAL
  1373. <--
  1374. (
  1375. Response=fail
  1376. [Reason=<string>] |
  1377. Response=success
  1378. [Reason=<string>]
  1379. Comments:
  1380. Deactivates admin identified by USER_CREDENTIAL
  1381. AdminTransferCard
  1382. -------------
  1383. -->
  1384. MessageType=request
  1385. Function=AdminTransferCard
  1386. TransactionToken=<string>
  1387. ServerTransactionToken=<string>
  1388. ADMIN_CREDENTIAL
  1389. CARD_CREDENTIAL
  1390. [GROUP_CREDENTIAL]
  1391. (
  1392. ToCardId=<#> |
  1393. (
  1394. (ToMagTrack=<#>)
  1395. ToMagStripe=<#> |
  1396. ToMagToken=<string>
  1397. ) |
  1398. (
  1399. [ToRFSite=<#>]
  1400. ToRFID=<#> |
  1401. ToRFIDToken=<string>
  1402. ) |
  1403. )
  1404. [(
  1405. ToGroupId=<#> |
  1406. ToGroupName=<string>
  1407. )]
  1408. <--
  1409. (
  1410. Response=fail
  1411. [Reason=<string>] |
  1412. Response=success
  1413. [Reason=<string>]
  1414. Comments:
  1415. Transfers card passes from CARD_CREDENTIAL to To(CardId|MagStripe|RFID)
  1416. credential. Transfers userid as well, overwriting previous userid with the
  1417. new one.
  1418. AdminTransferPass
  1419. -------------
  1420. -->
  1421. MessageType=request
  1422. Function=AdminTransferPass
  1423. TransactionToken=<string>
  1424. ServerTransactionToken=<string>
  1425. ADMIN_CREDENTIAL
  1426. PassId=<#>
  1427. (
  1428. ToCardId=<#> |
  1429. (
  1430. (ToMagTrack=<#>)
  1431. ToMagStripe=<#> |
  1432. ToMagToken=<string>
  1433. ) |
  1434. (
  1435. [ToRFSite=<#>]
  1436. ToRFID=<#> |
  1437. ToRFIDToken=<string>
  1438. ) |
  1439. )
  1440. [(
  1441. ToGroupId=<#> |
  1442. ToGroupName=<string>
  1443. )]
  1444. <--
  1445. (
  1446. Response=fail
  1447. [Reason=<string>] |
  1448. Response=success
  1449. [Reason=<string>]
  1450. Comments:
  1451. Transfers a single pass. Note a new pass is not created and the
  1452. logical_card_id of the pass is changed to point to the new card.
  1453. AdminGetPassOptions
  1454. -------------
  1455. -->
  1456. MessageType=request
  1457. Function=AdminGetPassOptions
  1458. TransactionToken=<string>
  1459. ServerTransactionToken=<string>
  1460. ADMIN_CREDENTIAL
  1461. NGroup=<#>
  1462. GroupName=<string>
  1463. [(
  1464. GroupName\[<i>\]=<string>
  1465. ){NGroup-1}]
  1466. <--
  1467. (
  1468. Response=fail
  1469. [Reason=<string>] |
  1470. Response=success
  1471. [Reason=<string>]
  1472. NPassOption=<#>
  1473. PassOptionId=<#>
  1474. GroupId=<#>
  1475. GroupName=<string>
  1476. Param=<string>
  1477. Name=<string>
  1478. Rule=<string>
  1479. Type=<string>
  1480. Description=<#>
  1481. Start=<date>
  1482. Expiration=<date>
  1483. DefaultNRide=<#>
  1484. DefaultNDay=<#>
  1485. NumPassOption=<#>
  1486. Option0=<string>
  1487. Option1=<string>
  1488. Option2=<string>
  1489. Option3=<string>
  1490. [(
  1491. PassOptionId\[=<#>
  1492. GroupId\[<i>\]=<#>
  1493. GroupName\[<i>\]=<string>
  1494. Param\[<i>\]=<string>
  1495. Name\[<i>\]=<string>
  1496. Rule\[<i>\]=<string>
  1497. Type\[<i>\]=<string>
  1498. Description\[<i>\]=<#>
  1499. Start\[<i>\]=<date>
  1500. Expiration\[<i>\]=<date>
  1501. DefaultNRide\[<i>\]=<#>
  1502. DefaultNDay\[<i>\]=<#>
  1503. NumPassOption\[<i>\]=<#>
  1504. Option0\[<i>\]=<string>
  1505. Option1\[<i>\]=<string>
  1506. Option2\[<i>\]=<string>
  1507. Option3\[<i>\]=<string>
  1508. ){NPassOption-1}]
  1509. Comments:
  1510. NPassOption is the number of pass options returned.
  1511. Param is the number of rides for an NRide type, the number of days for an
  1512. NDay type and blank for an other type.
  1513. Name is an identifier. The current convention is to have the rule without
  1514. the preceeding groupname if it's an other. If it's an NRide or NDay, the form
  1515. is:
  1516. ORG\.(NRIDE|NDAY)\.ZON([12])\.([AHY])\.(\d+)
  1517. where $1 is 'NRIDE' or 'NDAY' depending on which type it is, $2 is 1 or 2
  1518. depending on which zone it is, $3 is A for adult, H for half, Y for youth and
  1519. $4 is the parameter.
  1520. Rule is the database rule without group name prefix
  1521. Type is other, nride or nday
  1522. Description is a string description of the pass type
  1523. (Start|Expiration) are the start and expiration of the pass, should it have
  1524. a start and expiration date.
  1525. DefaultN(Ride|Day) are the default parameters for the passes
  1526. NumPriceOption is the number of PriceOption[0123] to use
  1527. PriceOption[0123] are strings meant to help the web site build it's drop
  1528. down of options. Currently the convention is:
  1529. NDAY: PriceOption0 is the zone identifier (e.g. 'Zone 1', 'Zone 2')
  1530. PriceOption1 is the nday identifier (e.g. 'Single', 'Double', 'Month')
  1531. NRide: PriceOption0 is the zone identifier
  1532. PriceOption1 is the nride identifier
  1533. PriceOption2 is the quantity identifier
  1534. Other: PriceOption0 is the pass description (e.g. 'Semester Spring (k-12, 2012, Zone1)')
  1535. AdminAddCardToUser
  1536. -------------
  1537. -->
  1538. MessageType=request
  1539. Function=AdminAddCardToUser
  1540. TransactionToken=<string>
  1541. ServerTransactionToken=<string>
  1542. ADMIN_CREDENTIAL
  1543. CARD_CREDENTIAL
  1544. USER_CREDENTIAL
  1545. <--
  1546. (
  1547. Response=fail
  1548. [Reason=<string>] |
  1549. Response=success
  1550. [Reason=<string>]
  1551. Comments:
  1552. Associates card to user
  1553. AdminRemoveCardFromUser
  1554. -------------
  1555. -->
  1556. MessageType=request
  1557. Function=AdminRemoveCardFromUser
  1558. TransactionToken=<string>
  1559. ServerTransactionToken=<string>
  1560. ADMIN_CREDENTIAL
  1561. CARD_CREDENTIAL
  1562. USER_CREDENTIAL
  1563. <--
  1564. (
  1565. Response=fail
  1566. [Reason=<string>] |
  1567. Response=success
  1568. [Reason=<string>]
  1569. Comments:
  1570. Dissassociates a card from a user (i.e. set userid=NULL for the user_card
  1571. entry)
  1572. AdminGetAdminPermissions
  1573. -------------
  1574. -->
  1575. MessageType=request
  1576. Function=AdminGetAdminPermissions
  1577. TransactionToken=<string>
  1578. ServerTransactionToken=<string>
  1579. ADMIN_CREDENTIAL
  1580. USER_CREDENTIAL
  1581. <--
  1582. (
  1583. Response=fail
  1584. [Reason=<string>] |
  1585. Response=success
  1586. [Reason=<string>]
  1587. NPermission=<#>
  1588. PrimaryGroupName=<string>
  1589. PrimaryGroupId=<#>
  1590. Table=<string>
  1591. Permission=<string>
  1592. GroupName=<string>
  1593. [(
  1594. Table=<string>
  1595. Permission=<string>
  1596. GroupName=<string>
  1597. ){NPermission-1}]
  1598. Comments:
  1599. Returns a list of tables the admin identified by USER_CREDENTIAL has access
  1600. to. Permissions are of type 'create', 'read', 'update', 'delete' (crud).
  1601. i.e. get all aro_aco entries for aro '/admins/<admin_name>' for aco subtree
  1602. '/org_db/'
  1603. AdminAddAdminPermissions
  1604. -------------
  1605. -->
  1606. MessageType=request
  1607. Function=AdminAddAdminPermissions
  1608. TransactionToken=<string>
  1609. ServerTransactionToken=<string>
  1610. ADMIN_CREDENTIAL
  1611. USER_CREDENTIAL
  1612. NPermission
  1613. Table=<string>
  1614. Permission=<string>
  1615. GroupName=<string>
  1616. [(
  1617. Table=<string>
  1618. Permission=<string>
  1619. GroupName=<string>
  1620. ){NPermission-1}]
  1621. <--
  1622. (
  1623. Response=fail
  1624. [Reason=<string>] |
  1625. Response=success
  1626. [Reason=<string>]
  1627. Comments:
  1628. adds aro_aco entry for aro '/admins/<admin_name>' and aco
  1629. '/org_db/<Table>/<Permission>' for admin identified by USER_CREDENTIAL
  1630. note, admin identified by ADMIN_CREDENTIAL must have 'update' permissions
  1631. on the table in question
  1632. AdminRemoveAdminPermissions
  1633. -------------
  1634. -->
  1635. MessageType=request
  1636. Function=AdminRemoveAdminPermissions
  1637. TransactionToken=<string>
  1638. ServerTransactionToken=<string>
  1639. ADMIN_CREDENTIAL
  1640. USER_CREDENTIAL
  1641. NPermission
  1642. Table=<string>
  1643. Permission=<string>
  1644. GroupName=<string>
  1645. [(
  1646. Table=<string>
  1647. Permission=<string>
  1648. GroupName=<string>
  1649. ){NPermission-1}]
  1650. <--
  1651. (
  1652. Response=fail
  1653. [Reason=<string>] |
  1654. Response=success
  1655. [Reason=<string>]
  1656. Comments:
  1657. removes aro_aco entry for aro '/admins/<admin_name>' and aco
  1658. '/org_db/<Table>/<Permission>' for admin identified by USER_CREDENTIAL
  1659. note, admin identified by ADMIN_CREDENTIAL must have 'delete' permissions
  1660. on the table in question
  1661. AdminAddAdminApiPermissions
  1662. -------------
  1663. -->
  1664. MessageType=request
  1665. Function=AdminAddAdminApiPermissions
  1666. TransactionToken=<string>
  1667. ServerTransactionToken=<string>
  1668. ADMIN_CREDENTIAL
  1669. UserName=<string>
  1670. NPermission=<#>
  1671. ApiFunction=<string>
  1672. [(
  1673. ApiFunction\[<i>\]=<string>
  1674. ){NPermission-1}]
  1675. <--
  1676. (
  1677. Response=fail
  1678. [Reason=<string>] |
  1679. Response=success
  1680. [Reason=<string>]
  1681. Comments:
  1682. Adds api function access to admin identified by 'UserName'. i.e. adds a new
  1683. aro_aco entry for aro '/admins/<UserName>' and aco '/api/<ApiFunction>'.
  1684. AdminRemoveAdminApiPermissions
  1685. -------------
  1686. -->
  1687. MessageType=request
  1688. Function=AdminRemoveAdminApiPermissions
  1689. TransactionToken=<string>
  1690. ServerTransactionToken=<string>
  1691. ADMIN_CREDENTIAL
  1692. UserName=<string>
  1693. NPermission=<#>
  1694. ApiFunction=<string>
  1695. [(
  1696. ApiFunction\[<i>\]=<string>
  1697. ){NPermission-1}]
  1698. <--
  1699. (
  1700. Response=fail
  1701. [Reason=<string>] |
  1702. Response=success
  1703. [Reason=<string>]
  1704. Comments:
  1705. Removes api function access to admin identified by 'UserName'. i.e. removes
  1706. aro_aco entry for aro '/admins/<UserName>' and aco '/api/<ApiFunction>'.
  1707. AdminSetAdminApiPermissions
  1708. -------------
  1709. -->
  1710. MessageType=request
  1711. Function=AdminSetAdminApiPermissions
  1712. TransactionToken=<string>
  1713. ServerTransactionToken=<string>
  1714. ADMIN_CREDENTIAL
  1715. UserName=<string>
  1716. NPermission=<#>
  1717. ApiFunction=<string>
  1718. [(
  1719. ApiFunction\[<i>\]=<string>
  1720. ){NPermission-1}]
  1721. <--
  1722. (
  1723. Response=fail
  1724. [Reason=<string>] |
  1725. Response=success
  1726. [Reason=<string>]
  1727. Comments:
  1728. Removes all api access functions for admin <UserName> and adds the
  1729. <ApiFuncion[<i>]> in their place.
  1730. AdminGetCustomCard
  1731. -------------
  1732. -->
  1733. MessageType=request
  1734. Function=AdminGetCustomCard
  1735. TransactionToken=<string>
  1736. ServerTransactionToken=<string>
  1737. ADMIN_CREDENTIAL
  1738. (
  1739. [MagTrack=<#>]
  1740. MagStripe=<#> |
  1741. MagToken=<#>
  1742. )
  1743. <--
  1744. (
  1745. Response=fail
  1746. [Reason=<string>] |
  1747. Response=success
  1748. [Reason=<string>]
  1749. MagStripe=(<#>|)
  1750. RFSite=(<#>|)
  1751. RFID=(<#>|)
  1752. CardId=<#>
  1753. Comment=<string>
  1754. LastUsed=<string>
  1755. Issued=<date>
  1756. FirstUsed=<date>
  1757. Comments:
  1758. The provided MagStripe should be the custom card id, without the
  1759. associated 'card number' (the last two digits as they exist on the magstripe).
  1760. This will only search custom cards.
  1761. AdminGetAdmins
  1762. -------------
  1763. -->
  1764. MessageType=request
  1765. Function=AdminGetAdmins
  1766. TransactionToken=<string>
  1767. ServerTransactionToken=<string>
  1768. ADMIN_CREDENTIAL
  1769. UserName=<string>
  1770. <--
  1771. (
  1772. Response=fail
  1773. [Reason=<string>] |
  1774. Response=success
  1775. [Reason=<string>]
  1776. NUsers=<#>
  1777. UserName=<string>
  1778. [(
  1779. UserName\[<i>\]=<string>
  1780. ){NUsers-1}]
  1781. Comments:
  1782. Returns a list of admins from the groups that the admin identified by
  1783. USER_CREDENTIAL has access to.
  1784. AdminSearchCards
  1785. -------------
  1786. -->
  1787. MessageType=request
  1788. Function=AdminSearchCards
  1789. TransactionToken=<string>
  1790. ServerTransactionToken=<string>
  1791. ADMIN_CREDENTIAL
  1792. SearchText=<string>
  1793. <--
  1794. (
  1795. Response=fail
  1796. [Reason=<string>] |
  1797. Response=success
  1798. [Reason=<string>]
  1799. NItem=<#>
  1800. CardId=<#>
  1801. MagToken=<string>
  1802. RFIDToken=<string>
  1803. Comment=<string>
  1804. UserId=<#>
  1805. LastUsed=<date>
  1806. FirstUsed=<date>
  1807. GroupId=<#>
  1808. UserName=<string>
  1809. GropuName=<string>
  1810. [(
  1811. CardId=<#>
  1812. MagToken=<string>
  1813. RFIDToken=<string>
  1814. Comment=<string>
  1815. UserId=<#>
  1816. LastUsed=<date>
  1817. FirstUsed=<date>
  1818. GroupId=<#>
  1819. UserName=<string>
  1820. GropuName=<string>
  1821. ){NItem-1}]
  1822. Comments:
  1823. Returns a list of cards that match SearchText when a wildcard match (
  1824. '%<SearchText>%' done on :
  1825. user_card.mag_token
  1826. user_card.rfid_token
  1827. user_card.comment
  1828. user_card.issued
  1829. user_card.lastused
  1830. user_card.firstused
  1831. user_card.username
  1832. groups.group_name
  1833. only active cards are returned.
  1834. There is a hard limit of 100 results returned.
  1835. AdminSearchUsers
  1836. -------------
  1837. -->
  1838. MessageType=request
  1839. Function=AdminSearchUsers
  1840. TransactionToken=<string>
  1841. ServerTransactionToken=<string>
  1842. ADMIN_CREDENTIAL
  1843. SearchText=<string>
  1844. <--
  1845. (
  1846. Response=fail
  1847. [Reason=<string>] |
  1848. Response=success
  1849. [Reason=<string>]
  1850. Address
  1851. City
  1852. Comment
  1853. Email
  1854. FirstName
  1855. LastName
  1856. NItem
  1857. Phone
  1858. ShippingAddress
  1859. ShippingCity
  1860. ShippingCountryCode
  1861. ShippingCountryName
  1862. ShippingName
  1863. ShippingState
  1864. ShippingZIP
  1865. State
  1866. UserId
  1867. UserName
  1868. ZIP
  1869. [(
  1870. Address\[<i>\]
  1871. City\[<i>\]
  1872. Comment\[<i>\]
  1873. Email\[<i>\]
  1874. FirstName\[<i>\]
  1875. LastName\[<i>\]
  1876. NItem\[<i>\]
  1877. Phone\[<i>\]
  1878. ShippingAddress\[<i>\]
  1879. ShippingCity\[<i>\]
  1880. ShippingCountryCode\[<i>\]
  1881. ShippingCountryName\[<i>\]
  1882. ShippingName\[<i>\]
  1883. ShippingState\[<i>\]
  1884. ShippingZIP\[<i>\]
  1885. State\[<i>\]
  1886. UserId\[<i>\]
  1887. UserName\[<i>\]
  1888. ZIP\[<i>\]
  1889. ){NItem-1}]
  1890. Comments:
  1891. Returns a of users that match SearchText when a wildcard match (
  1892. '%<SearchText>%' done on :
  1893. users.userid
  1894. users.username
  1895. users.first_name
  1896. users.last_name
  1897. users.phone
  1898. users.email
  1899. users.address
  1900. users.city
  1901. users.state
  1902. users.zip
  1903. users.comment
  1904. users.shipping_name
  1905. users.shipping_address
  1906. users.shipping_city
  1907. users.shipping_state
  1908. users.shipping_zip
  1909. users.shipping_country_code
  1910. users.shipping_country_name
  1911. groups.group_name
  1912. only active users are returned.
  1913. There is a hard limit of 100 results returned.
  1914. AdminSearchAdmins
  1915. -------------
  1916. -->
  1917. MessageType=request
  1918. Function=AdminSearchAdmins
  1919. TransactionToken=<string>
  1920. ServerTransactionToken=<string>
  1921. ADMIN_CREDENTIAL
  1922. SearchText=<string>
  1923. <--
  1924. (
  1925. Response=fail
  1926. [Reason=<string>] |
  1927. Response=success
  1928. [Reason=<string>]
  1929. NItem=<#>
  1930. GroupId=<#>
  1931. GroupName=<#>
  1932. UserId=<#>
  1933. UserName=<#>
  1934. [(
  1935. GroupId=<#>
  1936. GroupName=<#>
  1937. UserId=<#>
  1938. UserName=<#>
  1939. ){NItem-1}]
  1940. Comments:
  1941. Returns a list of admins that match SearchText when a wildcard match (
  1942. '%<SearchText>%' done on :
  1943. admins.username
  1944. admins.userid
  1945. admins.group_id
  1946. only active admins are returned.
  1947. There is a hard limit of 100 results returned.