Use cases
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Donec quis nibh at felis congue commodo. Nullam rhoncus aliquam metus. Mauris tincidunt sem sed arcu. Nam sed tellus id magna elementum tincidunt. Maecenas lorem. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
You will find here detailed descriptions of specific use cases for your needs. Get inspired by describing the best practices for integrating CareCloud platform REST API with your application and make your work easier. Using the related use cases will save you time and money!
The use case can apply to e-shop or production system integration, where you need access to all customer's data and request verification from the customer through the login screen.
We recommended customer verification following way:
- Display a sign-in form to the customer.
- You can display a choice of customer identifier. CareCloud API currently supports options for email and customer's card number.
- Alternatively, you can let the customer fills in his identifier without choosing a type and afterward decide on your side(form processing) if he filled email or customer's card. You can use regular expressions to make a decision.
- The customer fills in his credentials and sends the form.
- The application validates inputs (email format, customer's card format, password format) and informs the customer with an appropriate message in case of invalid input.
- If the customer enters all inputs correctly, the application will validate credentials against CareCloud API with the POST /customers/actions/verify-credentials call.
- Suppose CareClould API verifies a customer as a response. In that case, you will get a customer ID from CareCloud API, which you can use for receiving other customer information like purchases, reservations, loyalty information, or customer data.
- If verification is unsuccessful, you will be informed by an appropriate message from CareCloud API. Depending on the message, you can display your message to the customer in your application.
- The essential information is this use case was designed only for verification, so it doesn't mean the customer was logged in to CareCloud. If you want to log in customer, you need to keep this information on your side.
The use case can apply to e-shop or production system integration, where you need access to data of multiple customers or search for a customer by his identifiers (email, phone number, or name).
We recommended searching customer’s data following way:
- If you need to search for data from one or multiple customers, use the resource GET /customers. To find one or more customers, you need to know their email, phone number, first name, last name, or birthdate.
- Add them into query parameters. The more parameters you fill in, the better and more exact the result will be. In this method, you can get multiple results if the parameter’s value is general, like “name=John”.
- The response contains customer information, including ID, personal data, or consent, that you can process as needed.
- If you want to search for one specific customer and expect only one result from searching, please use the action method GET /customers/actions/search-customers.
- Use strict mode in query parameters. In this mode, you must know the first name, last name, birth date, and customer’s card number.
- If CareCloud has this customer, you are going to get an ID.
- To access the customer’s data, you need to do one extra CareCloud API call where you will add the customer ID from the previous call as a path parameter GET /customers/{customer_id}.
- Every resource or method from previous points returns structures with the customer ID. This ID can be used for other resources as a path parameter to limit results tied to the customer. For example, customer vouchers GET /customers/{customer_id}/vouchers or customer card GET /customers/{customer_id}/cards or customer properties GET /customers/{customer_id}/property-records and other you can find in API reference guide: https://developers.crmcarecloud.com/#tag/Customers
The use case can apply to mobile application or customer portal integration, where you need access to data logged in customer.
We recommended searching customer’s data following way:
- To access customer data in this use case, it is mandatory, the customer is logged in. If you need to know ho to login customer please look at Log in and log out customer use case
- To access personal data of the customer please use resource GET /customers.
- You don’t need to add any path or query parameter. CareCloud API will return information about logged in customer.
- The response contains customer information, including ID, personal data, or consent, that you can process as needed.
- In case you want to access extended data about customer - his properties, please use the following endpoint GET customers/property-records.
The use case can apply to mobile applications or customer portal integration, where you have to log in to a customer account to access his personal information or other data.
This process requires the device to have an application token to access CareCloud API. How to get and use application tokens is available in the Authentication section.
We recommend you create a login process following way:
- The first step is to receive your customer's login and password through your application's login screen. Since the verification of credentials is on the CareCloud servers for security reasons, you don't need to store the customer's login and password in the application.
- After the customer submits the form, the application should validate login (usually email address) and password against requirements from CareCloud API documentation.
- Successful validation triggers the login action method called POST /tokens/{token_id}/actions/login.
- If an error message is returned, you need to follow guidance depending on the message.
- In case of a successful result, the application will receive customer identification.
- You can call most of the resources in CareCloud API without the identification of the customer if the customer is logged in. For example, information about the logged-in customer is available at the endpoint GET /customers. The ID is not necessary, CareCloud recognizes the customer and returns his information.
- Call the API action method GET /tokens/{token_id}/actions/logout if your customer requests a logout.
- After logging out, the application can call only resources available without logged-in customers.
- There are only two ways to log out a customer, one is a logout method, and the other one is when the application token loses validity. You can read more about application token in the use case "Mobile application/customer portal access to CareCloud API"
Updating the customer is a critical process, and it is crucial to do it right so you keep the customer's data. For an update, please follow this use case:
- For an update, you need to know the customer's original data first. If you don't store all the customer’s data in your system, you need to call information about the customer with API call GET /customers where you will receive all the customer data. Now you are good to go for customer updates.
- When you have the customer’s data, you can modify them and update them with endpoint PUT /customers. This endpoint has to contain all the customer information because you are updating all customer data. All parameters that won't be set in the request will be lost because of the principle of the HTTP PUT verb.
- The successful update is represented by 204 HTTP code. In case of an error, the error message explains the issue.
- If you need to update a customer’s properties, please use endpoint PUT /customers/property-records/{property_record_id}. There you can modify existing properties.
The use case can be applied to the mobile application or customer portal integration, where a customer needs to change his password in CareCloud.
We recommended changing the customer's password following way:
- The customer can request a change if he doesn't remember his password. All passwords are securely saved and protected on the CareCloud servers, so the customer's application doesn't need to store passwords and risk the application data leak.
- The customer fills in the contact information(email, phone number, or others if the project allows it) to the form. The application validates the contact structure.
- The application sends a request to the CareCloud action method POST /tokens/{token_id}/actions/send-password-setup-email
- The CareCloud validates the contact and checks its existence in the customer database. If the contact is present, CareCloud sends a message with the link to change the password. CareCloud users can configure the contact(email/phone) template in the CareCloud application Campaigns & Segmentation if needed.
- The customer opens the message and clicks on the link.
- The customer is forwarded to the form for password change in CareCloud.
- The customer fills out the form with a new password, and the application validates the amount and type of the characters in the password.
- After successfully changing the password, the customer is forwarded depending on the customer source he has assigned. Forward URL is possible to set up at the customer source administration in CareCloud.
The use case can apply to e-shop or production system integration, where a customer needs to change his password in CareCloud.
We recommended changing the customer's password in the following way:
- The customer can request a change if he doesn't remember his password.
- The customer fills in the email address to the application form. The application validates the email address structure.
- After the email address validation, the application checks its existence in CareCloud with an API call GET /customers. If the email address is present, the application sends an email with the link to change the password.
- The customer opens an email and clicks on the link.
- The customer is forwarded to the application form for password change.
- The customer fills out the form with a new password, and the application validates the amount and type of the characters in the password(It must follow the CareCloud API restriction for the password PUT /customers/{customer_id}).
- After successful validation, the application has to update a new password in the customer’s account. For that, the application has to do a CareCloud API call PUT /customers/{customer_id} with the new password.
- If successful, the application shows a success message to the customer and forwards him to the login form.
JOIN OUR CLOUD
Ready to Meet CareCloud?
Fill in your contact details to get answers to the questions you have about CareCloud – from product description and pricing to casual talk about your customers and your business.
One of our experts will contact you soon.
By submitting this form, you confirm that you agree to the processing of your personal data by Cortex and contacting you to fulfill your request. Your data will be deleted after we meet your request unless a mutual agreement on further processing has been concluded. Your data is secure.