Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page will provide the API contracts for LC user registration.

Info

API DOC LINK


POST:

Description: Create patron.
API: https://folio-dev-volaris-edge.ci.folio.org/patron/account/{patronIdexternalSystemID}? apiKeyapikey=eyJzIjoiWDhoYmM1THJDeSIsInQiOiJ0ZXN0ZWRnZWRjYiIsInUiOiJkY2JDbGllbnQifQeyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==

NOTE:- we can provide any existing id of a patron OR extSystemId externalSystemID of an existing user.(will be used internally to perform operation on behalf of the user)

PAYLOAD:

Code Block
{
   "generalInfo": {
      "externalSystemId": "ext-5555-kapil-new-record-100",
      "firstName": "sdfdgfsfsdnew-record-100",
      "preferredFirstName": "dfsdNew Record",
      "middleName": "bbb",
      "lastName": "cccnew-record-100"
   },
   "address0addressInfo": {
      "addressLine0": "123 Main St",
      "addressLine1": "Apt 4B",
      "city": "Metropolis",
      "province": "NY",
      "zip": "12345",
    "country": "USA"
  },
  "address1": {
    "addressLine0": "456 Side St",
    "addressLine1": "Suite 500",
    "city": "Metropolis",
    "province": "NY",
    "zip": "12346",     "country": "USA"
   },
   "contactInfo": {
      "phone": "555-112233123456",
      "mobilePhone": "555-5678",
      "email": "test@maivffglnew-record-100@test.com"
   },
   "preferredEmailCommunication": ["ProgramsSupport", "SupportPrograms", "ServiceServices"]
}

RESPONSE:

-A user will be created with userType “patron” and patron_group “Remote Non-circulating“ ,

-Address0 as primary address and addressType as work.-Address1 as secondary address and addressType as home if present.addressInfo is stored in Folio as Home
-

Code Block
  {
    "generalInfo": {
        "externalSystemId": "ext-5555-kapil-new-record-100",
        "firstName": "sdfdgfsfsdnew-record-100",
        "preferredFirstName": "dfsdNew Record",
        "middleName": "bbb",
        "lastName": "cccnew-record-100"
    },
    "address0addressInfo": {
        "addressLine0": "123 Main St",
        "addressLine1": "Apt 4B",
        "city": "Metropolis",
        "province": "NY",
        "zip": "12345",
        "country": "USA"
    },
    "address1contactInfo": {

   "addressLine0": "456 Side St",     "addressLine1phone": "Suite 500555-123456",
    "city": "Metropolis",     "provincemobilePhone": "NY555-5678",

   "zip": "12346",     "countryemail": "USAnew-record-100@test.com"
    },
    "contactInfopreferredEmailCommunication": {[
       "phone": "555-112233Support",
    "mobilePhone":    "555-5678Programs",
       "email": "test@maivffglServices"
  },
  "preferredEmailCommunication": ["Programs","Support","Service"]
}

PUT:

Description: Update patron by email.
API: https://folio-dev-volaris-edge.ci.folio.org/patron/account/{patronIdexternalSystemID}/by-email/{emailId}? apiKey=eyJzIjoiWDhoYmM1THJDeSIsInQiOiJ0ZXN0ZWRnZWRjYiIsInUiOiJkY2JDbGllbnQifQext-kapil-2@test.com?apikey=eyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==

PAYLOAD:

Code Block
{
   "generalInfo": {
      "externalSystemId": "ext-kapil-55552",
 
  "firstName": "sdfdgfsfsd",     "preferredFirstNamefirstName": "dfsdKapil2",
    "middleName": "bbb",     "lastNamepreferredFirstName": "DDD"Inactive  or },Expired   "address0": {
    "addressLine0": "123 Main St",
    "addressLine1and Remote Non-circulation",
    "middleName": "Apt 4B",
 
  "city": "Metropolis",     "provincelastName": "NYSony",
    "zip": "12345" },
    "countryaddressInfo": "USA"{
  },   "address1": {
    "addressLine0": "456123 SideMain St",
      "addressLine1": "SuiteApt 5004B",
      "city": "Metropolis",
      "province": "NY",
      "zip": "1234612345",
      "country": "USA"
   },
   "contactInfo": {
      "phone": "555-112233123456",
      "mobilePhone": "555-5678",
      "email": "test@maivffglext-kapil-2@test.com"
   },
   "preferredEmailCommunication": ["Programs","Support", "ServicePrograms"]
}

RESPONSE:

A user will be updated with provided payload with API response 204

...

Description: Get patron by email.
API: https://folio-dev-volaris-edge.ci.folio.org/patron/account/{patronIdexternalSystemID}/by-email/{emailId}? apiKey=eyJzIjoiWDhoYmM1THJDeSIsInQiOiJ0ZXN0ZWRnZWRjYiIsInUiOiJkY2JDbGllbnQifQext-kapil-2@test.com?apikey=eyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==

PAYLOAD: none

RESPONSE:

A user will be returned in the form of external_patron .

Code Block
 {
    "generalInfo": {
        "city"externalSystemId": "ext-kapil-new-record-100",
        "firstName": "Metropolisnew-record-100",
          "provincepreferredFirstName": "NYNew Record",
          "zipmiddleName": "12345",
           "countrylastName": "USA"
 new-record-100"
    },
     "address1addressInfo": {
           "addressLine0": "456123 SideMain St",
           "addressLine1": "SuiteApt 5004B",
          "city": "Metropolis",
   
        "province": "NY",
          "zip": "1234612345",
           "country": "USA"
     },
     "contactInfo": {
          "phone": "555-112233123456",
           "mobilePhone": "555-5678",
   
        "email": "test@maivffglnew-record-100@test.com"
     },
     "preferredEmailCommunication": ["Programs","Support","Service"]
}

        "Support",
        "Programs",
        "Services"
    ]
}

GET:

Description: Get expired LC patrons.
API: https://folio-dev-volaris-edge.ci.folio.org/patron/account/{patronIdexternalSystemID}? apiKey=eyJzIjoiWDhoYmM1THJDeSIsInQiOiJ0ZXN0ZWRnZWRjYiIsInUiOiJkY2JDbGllbnQifQ==/external-patrons?apikey=eyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==&expired=true

PAYLOAD: noneNOTE:

Request parameter expired=true can be passed in order to get expired LC usersNote : This API will fetch expired users for previous day only (business day -1).

RESPONSE:

A collection of LC users will be returned in the form of external_patron_collection .

Code Block
{
    "externalPatrons": [
        {
            "generalInfo": {
                "externalSystemId": "ext123ext-kapil-2",
                "firstName": "JohnKapil2",
                "preferredFirstName": "JohnnyInactive or Expired and Remote Non-circulation",
 
      "middleName": "Michael",         "lastName": "Doe"Kapil2"
            },
      "address0      "addressInfo": {
                "addressLine0": "123 Main St",
                "addressLine1": "Apt 4B",
                "city": "AnytownMetropolis",
        "province": "California",
        "zipcountry": "12345",
          "country": "USA" },
     },       "contactInfo": {
                "phone": "123555-456-7890123456",
                "mobilePhone": "987555-654-32105678",
                "email": "john.doe@example.com"ext-kapil-2@test.com"
            },
            "preferredEmailCommunication": ["Support",
"Programs"]     },     {       "generalInfo": {
 Programs",
      "externalSystemId": "ext456",         "firstNameSupport":
"Jane",         "preferredFirstName": "Janey",  ]
      "lastName": "Smith" }
     }],

     "address0totalRecords": {1 
  }

Error Code Responses

ERROR CODE for ALL the API’s (negative scenarios) : Also below codes are found in API DOC: API DOC LINK

Sample Error Responses:

API TYPE

ERROR

Response JSON

POST

API DOC LINK

422: User account is not active

Code Block
{
    "

...

code": 422,

...

 

...

 

...

  "errorMessage": "USER_ACCOUNT_INACTIVE"
}

422: User does not belong to the required patron group

Code Block
{
    "

...

code": 

...

422,
    

...

"

...

errorMessage": "

...

INVALID_PATRON_GROUP"
}

422: User already exists

Code Block
{
    "code": 422,
    "

...

errorMessage": "

...

USER_ALREADY_EXIST"
}

422: Multiple users with email

Code Block
{
    "code": 422,
    "

...

errorMessage": "

...

MULTIPLE_USER_WITH_EMAIL"
}

PUT

API DOC LINK

404: user does not exist

Code Block
{
    "code": 404,
    "

...

errorMessage": "

...

USER_NOT_FOUND"
}

422: User already exist with email provided in payload

Code Block
{
    "code": 

...

422,
    

...

"errorMessage": "

...

EMAIL_ALREADY_EXIST"
}

422: Multiple users found with the same email

Code Block
{
    "code": 422,
    "

...

errorMessage": "

...

MULTIPLE_USER_WITH_EMAIL"
}

422: Required Patron group not applicable for user

Code Block
{
    

...

"

...

code": 

...

422,
    

...

"

...

errorMessage": "

...

PATRON_GROUP_NOT_APPLICABLE"
}

GET by email

API DOC LINK

404: User does not exist

Code Block
{
    "code": 

...

404,
    

...

"

...

errorMessage": 

...

"

...

USER_NOT_FOUND"

...


}

422: Multiple users found with the same email

Code Block
{
    

...

"code": 422,
 

...

   "

...

errorMessage": 

...

"MULTIPLE_USER_WITH_EMAIL"
}