/
LC Staging-User Registration Contract (NEW) - Draft

LC Staging-User Registration Contract (NEW) - Draft

4044Purpose:

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

 

Swagger UI Doc

POST:

Description: Create a new Staging-User.

API: POST /patron

URL: https://folio-dev-volaris-edge.ci.folio.org/patron?apikey=eyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==

NOTE:- externalSystemId will be generated in background randomly with UUID format.

PAYLOAD:

{ "isEmailVerified": true, (Optional, default false if not passed) "status": "TIER-2", (Optional, default TIER_1 if not passed) "generalInfo": { "firstName": "Kapil", "middleName": "Verma", "lastName": "Soni" }, "addressInfo": { "addressLine0": "123 Main St", "addressLine1": "Apt 4B", "city": "Metropolis", "province": "NY", "zip": "12345", "country": "USA" }, "contactInfo": { "phone": "555-123456", "mobilePhone": "555-5678", "email": "kapil@foliotest.com" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] }

RESPONSE:

Response code 201 Created will be returned along with below response body containing random externalSystemId:-

{ "id": "cd0bba83-2542-4933-961b-fb5513c50fc1", "externalSystemId": "100d10bf-2f06-4aa0-be15-0b95b2d9f9e3", "isEmailVerified": true, "status": "TIER-2", "generalInfo": { "firstName": "new-record-kapil-12345", "middleName": "middleName", "lastName": "new-record-Soni" }, "addressInfo": { "addressLine0": "123 Main St", "addressLine1": "Apt 4B", "city": "Metropolis", "province": "NY", "zip": "12345", "country": "USA" }, "contactInfo": { "phone": "555-123456", "mobilePhone": "555-5678", "email": "new-record-kapil-12345@test.com" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] }

 

PUT:

Description: Update an existing Staging-User.
API: PUT /patron/{externalSystemId}

URL: https://folio-dev-volaris-edge.ci.folio.org/patron/{externalSystemId}?apikey=eyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==

NOTE:- if contactInfo.emailId is provided in body then we will ignore it since email is not modifiable.

Payload

{ "isEmailVerified": true, "status": "TIER-2", "generalInfo": { "firstName": "Kapil", "middleName": "Verma", "lastName": "Soni" }, "addressInfo": { "addressLine0": "123 Main St", "addressLine1": "Apt 4B", "city": "Metropolis", "province": "NY", "zip": "12345", "country": "USA" }, "contactInfo": { "phone": "555-123456", "mobilePhone": "555-5678" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] }

RESPONSE:

Response code 200 OK will be returned along with below response body:-

{ "id": "cd0bba83-2542-4933-961b-fb5513c50fc1", "externalSystemId": "100d10bf-2f06-4aa0-be15-0b95b2d9f9e3", "isEmailVerified": true, "status": "TIER-2", "generalInfo": { "firstName": "new-record-kapil-12345", "middleName": "middleName", "lastName": "new-record-Soni" }, "addressInfo": { "addressLine0": "123 Main St", "addressLine1": "Apt 4B", "city": "Metropolis", "province": "NY", "zip": "12345", "country": "USA" }, "contactInfo": { "phone": "555-123456", "mobilePhone": "555-5678", "email": "new-record-kapil-12345@test.com" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] }

GET:

Description: Get Staging-User registration status by email or externalSystemId.

API:

For emailId: GET /patron/registration-status?emailId=kapil@foliotest.com

OR

For externalSystemId: GET /patron/registration-status?externalSystemId=100d10bf-2f06-4aa0-be15-0b95b2d9f9e3

URL: https://folio-dev-volaris-edge.ci.folio.org/patron/registration-status?apikey=eyJzIjoieHFpNzNjNEZzOSIsInQiOiJkaWt1IiwidSI6ImRpa3VfYWRtaW4ifQ==&emailId=kapil@foliotest.com

RESPONSE:

{ "id": "cd0bba83-2542-4933-961b-fb5513c50fc1", "externalSystemId": "100d10bf-2f06-4aa0-be15-0b95b2d9f9e3", "active": true, "type": "patron", "patronGroup": "3a0e61a4-d780-5d02-93b9-9dd86a8054e1", "departments": [], "proxyFor": [], "personal": { "lastName": "new-record-Soni", "firstName": "new-record-kapil-12345", "middleName": "middleName", "email": "polina2@test.com", "phone": "555-123456", "mobilePhone": "555-5678", "addresses": [ { "id": "f09fe417-2c56-4570-a9c1-012a6787879b", "countryId": "USA", "addressLine1": "123 Main St", "addressLine2": "Apt 4B", "city": "Metropolis", "region": "NY", "postalCode": "12345", "addressTypeId": "93d3d88d-499b-45d0-9bc7-ac73c3a19880", "primaryAddress": true } ], "preferredContactTypeId": "002" }, "enrollmentDate": "2024-11-19T07:08:58.195+00:00", "expirationDate": "2026-11-19T00:00:00.000+00:00", "metadata": { "createdDate": "2024-11-19T07:09:17.340+00:00", "createdByUserId": "17054c6e-a576-41a6-9134-e9f888b1535c", "updatedDate": "2024-11-19T07:09:17.340+00:00", "updatedByUserId": "17054c6e-a576-41a6-9134-e9f888b1535c" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] }

 

 

Error Code Responses

ERROR CODE for ALL the API’s (negative scenarios) :

Sample Error Responses:

API TYPE

ERROR

Response JSON

API TYPE

ERROR

Response JSON

POST

 

422: if any conflict occurred or validation issue

{ "code": 422, "errorMessage": "error msg" }

400: if any bad request

{ "code": 422, "errorMessage": "error msg" }

500: if any internal server error

text/plaintype response

something went wrong or any relevant msg

 

 

PUT

 

422: if any conflict occurred or validation issue

{ "code": 422, "errorMessage": "error msg" }

400: if any bad request

{ "code": 422, "errorMessage": "error msg" }

500: if any internal server error

 

something went wrong or any relevant msg text/plaintype response

404: Staging user does not exist

{ "code": "STAGING_USER_NOT_FOUND", "errorMessage": "Staging user does not exist" }

GET registration-status by

email or externalSystemId

 

400: Multiple users found with the same email

{ "code": "MULTIPLE_USER_WITH_EMAIL", "errorMessage": "Multiple users found with the same email" }

404: User account is not active

{ "code": "USER_ACCOUNT_INACTIVE", "errorMessage": "User account is not active" }

 

404: User does not exist

{ "code": "USER_NOT_FOUND", "errorMessage": "User does not exist" }

Related content