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== API:

NOTE:- we can provide any existing id of a patron OR 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"
   },
   "address1contactInfo": {
      "addressLine0phone": "555-123456"456,
Side St",     "addressLine1mobilePhone": "Suite 500555-5678",
      "cityemail": "Metropolis"new-record-100@test.com"
  },
    "provincepreferredEmailCommunication": ["Support", "NYPrograms", "Services"]
}

RESPONSE:

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

-addressInfo is stored in Folio as Home
-

Code Block
    "zip {
    "generalInfo": {
        "externalSystemId": "12346ext-kapil-new-record-100",
          "countryfirstName": "USA"
  },
  "contactInfo": {
    "phonenew-record-100",
        "preferredFirstName": "New Record",
        "middleName": "555-112233",
          "mobilePhonelastName": "555new-record-5678",
    "email": "test@maivffgl"
  },
  "preferredEmailCommunication": ["Programs","Support","Service"]
}

RESPONSE:

A user will be created with userType “patron”, Address1 as primary address and addressType as work.

Code Block
  {
  "generalInfo": {100"
    },
    "addressInfo": {
        "addressLine0": "123 Main St",
        "addressLine1": "Apt 4B",
        "city": "Metropolis",
        "province": "NY",
        "externalSystemIdzip": "ext-555512345",
        "firstNamecountry": "sdfdgfsfsd",USA"
    },
    "contactInfo": {
        "preferredFirstNamephone": "dfsd555-123456",
        "middleNamemobilePhone": "bbb555-5678",
        "lastNameemail": "cccnew-record-100@test.com"
    },
    "address0preferredEmailCommunication": [
   {     "addressLine0": "123 Main St",
    "addressLine1": "Apt 4BSupport",
        "Programs",
        "Services"
    ]
}

PUT:

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

PAYLOAD:

Code Block
{
  "generalInfo": {
    "externalSystemId": "ext-kapil-2",
    "cityfirstName": "MetropolisKapil2",
    "provincepreferredFirstName": "NYInactive or Expired and Remote Non-circulation",
    "zipmiddleName": "12345",
    "countrylastName": "USASony"
  },
  "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@maivffglext-kapil-2@test.com"
  },
  "preferredEmailCommunication": ["Programs","Support", "ServicePrograms"]
}

...

RESPONSE:

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

GET:

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": {
           "externalSystemId": "ext-5555kapil-new-record-100",
          "firstName": "sdfdgfsfsdnew-record-100",
          "preferredFirstName": "dfsdNew Record",
          "middleName": "bbb",
          "lastName": "DDD"
 new-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-112233",     "mobilePhone": "555-5678Support",
    "email": "test@maivffgl"   },   "preferredEmailCommunication": ["Programs","Support","Service"
        "Services"
    ]
}

RESPONSEGET:

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

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

PAYLOAD: none

Note : This API will fetch expired users for previous day only (business day -1).

RESPONSE:

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

Code Block
  "city{
    "externalPatrons": [
        {
            "generalInfo": {
                "externalSystemId": "Metropolis",
    "provinceext-kapil-2",
                "firstName": "NYKapil2",
    "zip
                "preferredFirstName": "12345",
    "countryInactive or Expired and Remote Non-circulation",
                "lastName": "USA"
 Kapil2"
            },
 
            "address1addressInfo": {
   
                "addressLine0": "456123 SideMain St",
   
                "addressLine1": "SuiteApt 5004B",
   
                "city": "Metropolis",
          "province": "NY",     "zip": "12346",     "country": "USA"
 "
            },
 
            "contactInfo": {
                   "phone": "555-112233123456",
   
                "mobilePhone": "555-5678",
   
                "email": "test@maivffgl"
  },
 ext-kapil-2@test.com"
            },
            "preferredEmailCommunication": [
                "Programs",
                "Support"
            ]
        }
    ],"Service"]
}

    "totalRecords": 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"
}