Notifications: Difference between revisions

From SafeStamper API documentation
Jump to navigation Jump to search
api>Admin
 
m 1 revision imported
 
(No difference)

Latest revision as of 06:27, 17 October 2023

This operation lists the notifications of the authorizing user.

URL

https://www.safestamper.com/api/notifications

Parameters

  • sharedkey: Your API client shared key
  • authkey: Authorization key
  • fromDate: Return notifications sent from this date on (optional, format yyyy-MM-dd)
  • toDate: Return notifications sent up to this date (optional, format yyyy-MM-dd)
  • filter: Text for searching notifications (optional)
  • page: Page number to return (optional, defaults to 1)
  • signature: Parameters signature, as explained in Signature parameter

Returns

A JSON object with the following fields:

  • pageSize: Maximum number of notifications per page
  • count: Total number of notifications
  • pageTotal: Total number of pages
  • list: array of JSON with the notification data
    • entryDate: Date of notification
    • code: Notification code
    • subject: Subject of notification
    • body: Body content of notification
    • recipientType: Send type of the notification
    • recipientMail: E-mail address of the notification recipient
    • recipientPhone: Phone of the notification recipient
    • recipientName: Name of the notification recipient
    • attachmentName: Attachment name of notification
    • state: State of notification
      • PENDING The notification is pending to read
      • READ The notificaction has been read
    • certificates: List of certificates generated from this notification
      • entryDate: Date of certificate
      • code: Certificate code
      • url: Public URL for certificate download
    • readings: List of readings of this notification
      • ip: IP from which the notification was read
      • country: Country code from which the notification was read
      • city: City from which the notification was read
      • date: Date read
      • downloadAttachment: Indicates if the attachment was downloaded

HTTP Errors

  • 403 Forbidden: the sharedkey or signature are not valid
  • 401 Unauthorized: authkey is not valid or not authorized

Example

REQUEST:

https://www.safestamper.com/api/notifications
?authkey=0dbb406d-cc0c-4ef8-ae80-971ed108c2f9
&sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&signature=b1b22b34967fdf2eb67c3569a1e8b90f9fb63e77

RESPONSE (actual response has no line breaks or indentation):

{
  "pageSize": 50,
  "count": 1,
  "pageTotal": 1,
  "list": [
    {
      "entryDate": "2017-03-16T12:59:08Z",
      "code": "170316-6K5D2Q",
      "state": "READ",
      "subject": "Example notification",
      "body": "Notification text",
      "recipientType": "EMAIL",
      "recipientMail": "jdoe@example.com",
      "recipientPhone": "",
      "recipientName": "John Doe",
      "certificates": [
        {
          "entryDate": "2017-03-16T12:59:44Z",
          "code": "170316-WMZMFS",
          "url": "http:\/\/www.safestamper.com\/certificate\/170316-WMZMFS",
        }],
      "readings": [
        {
          "ip": "127.0.0.1",
          "date": "2017-03-16T12:59:34Z",
          "downloadAttachment": "false"
        }]
    }}

}