Patron Messages

List All Patron Messages

GET /api/.../patrons/{id}/messages

Returns all messages associated with the patron.

Request Information

Parameters
Name Type Required Description
id Integer Yes The unique id assigned to the patron.

Response Information

{MessageType} values: 100 - system defined, 101 - Free text.

Example
application/json, text/json
[
    {
        "PatronID": 357979,
        "MessageType": 101,
        "MessageID": 73,
        "MessageValue": "This is a free text message for this patron!",
        "HasPatronRead": false,
        "Organization": "Main Public Library",
        "Creator": "gsmith",
        "Workstation": "CIRC-01",
        "CreationDate": "2013-02-28T17:11:53.8205252-05:00",
        "Modifier": "jones",
        "ModificationDate": "2013-04-01T17:11:53.8205252-05:00"
    },
    {
        "PatronID": 357979,
        "MessageType": 100,
        "MessageID": 11,
        "MessageValue": "Renew your items online at http://qa-plato/polaris",
        "HasPatronRead": false
        "Organization": "Main Public Library",
        "Creator": "gsmith",
        "Workstation": "CIRC-01",
        "CreationDate": "2013-02-28T17:11:53.8205252-05:00",
        "Modifier": null,
        "ModificationDate": null
    }
]

HTTP Response Codes

Code Description
200 OK. Success
404 FAILURE. Invalid PatronID.

Add a Patron Message

POST /api/.../patrons/{id}/message

Add either a library-defined or free text message for a patron.

Request Information

URL Parameters
Name Type Required Description
id Integer Yes The unique id assigned to the patron.
POST Form Data

If creating a library-defined patron message, provide the following in the form/body of the request:

Name Type Required Description
MessageType Integer Yes Use value '100' (library-defined)
MessageID Integer Yes The ID of the library-defined message (from the list returned from the System Patron Message API call)

If creating a free text patron message, provide the following in the form/body of the request:

Name Type Required Description
MessageType Integer Yes Use value '101' (free text)
MessageValue String Yes Free text message (up to 255 characters)

Response Information

The full Patron Message is returned upon success.

Example
application/json, text/json
{
    "PatronID": 357979,
    "MessageType": 101,
    "MessageID": 73,
    "MessageValue": "This is a free text message for this patron!",
    "HasPatronRead": false,
    "Organization": "Main Public Library",
    "Creator": "gsmith",
    "Workstation": "CIRC-01",
    "CreationDate": "2013-02-28T17:11:53.8205252-05:00",
    "Modifier": null,
    "ModificationDate": null
}

HTTP Response Codes

Code Description
200 OK. Success
400 FAILURE.
  • MessageType must be 100 or 101
  • Invalid MessageID
  • Invalid MessageValue
  • If the error message mentions a primary key contraint and the add request was a library-defined message (100), this means the message already exists for this patron.
  • MessageValue is greater than 255 characters
404 FAILURE. Invalid PatronID.
409 CONFLICT. Patron record is secured.

Modify a Patron Message

PUT /api/.../patrons/{id}/message/{messageid}

Modify either a library-defined or free text message for a patron.

Request Information

URL Parameters
Name Type Required Description
id Integer Yes The unique id assigned to the patron.
messageid Integer Yes The id of the existing message being modified.
PUT Form Data
If modifying a library-defined patron message, provide the following in the form/body of the request:

Name Type Required Description
MessageType Integer Yes Use value '100' (library-defined)
MessageID Integer Yes The ID of the library-defined message that should replace the {messageid} provided on the url.

If modifying a free text patron message, provide the following in the form/body of the request:

Name Type Required Description
MessageType Integer Yes Use value '101' (free text)
MessageValue String Yes Updated free text message (up to 255 characters)

Response Information

The full, updated Patron Message is returned upon success.

Example
application/json, text/json
{
    "PatronID": 357979,
    "MessageType": 101,
    "MessageID": 73,
    "MessageValue": "This is the updated free text message for this patron!",
    "HasPatronRead": false,
    "Organization": "Main Public Library",
    "Creator": "gsmith",
    "Workstation": "CIRC-01",
    "CreationDate": "2013-02-28T17:11:53.8205252-05:00",
    "Modifier": "jones",
    "ModificationDate": "2013-04-01T17:11:53.8205252-05:00"
}

HTTP Response Codes

Code Description
200 OK. Success
400 FAILURE.
  • MessageType must be 100 or 101
  • Invalid MessageValue
  • If the error message mentions a primary key contraint and the add request was a library-defined message (100), this means the message already exists for this patron.
  • Error code of 10000 with message of "MessageValue is greater than 255 characters."
404 FAILURE.
  • Invalid PatronID
  • Invalid MessageID
409 CONFLICT. Patron record is secured.

Delete a Patron Message

DELETE /api/.../patrons/{id}/message/{messagetypeid}/{messageid}

Delete either a library-defined or free text message for a patron.

Request Information

URL Parameters
Name Type Required Description
id Integer Yes The unique id assigned to the patron.
messagetypeid Integer Yes '100' for library-defined, '101' for free text.
messageid Integer Yes The unique id assigned to the message.

HTTP Response Codes

Code Description
200 OK. Success
404 FAILURE.
  • MessageID or PatronID is an invalid value
  • MessageType must be either 100 or 101
409 CONFLICT. Patron record is secured.