JSON API » cards » cards/list

Gets the fields of all cards in a given group or batch.

Input parameters

Requires authentication and the cards role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
batchIntegerID of card batch to get cards for.No
cardgroupIntegerID of card group to get cards for.No
countInteger1 to return a count, 0 to return full data.No0
descendingInteger1 to sort descending, 0 not to.No0
limitIntegerThe maximum results to return. 0 for all.No0
offsetIntegerThe result to start at. 0 for the first.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
sortStringField to sort by. "card", "created", "expires", "balance", "serial"No"card"

Either batch or cardgroup must be specified.

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The cardgroup or batch specified does not exist, or you do not have permission to view it.

Data returned

An array of fields, corresponding to the rows of the cards table in the database.

Example: With card group

http://enswitch.example.com/api/json/cards/list/?auth_username=user;auth_password=password;cardgroup=123

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "card":"1234567890", ... }, { "card":"2345678901", ... } ] }

Change history

VersionChanges
3.13Function added.