Russian  English  All projects

Joomla integration with third-party service



Need

1. add a modal window
2. in which one text field (with validation), which dials the number (you will need to filter and transmit to the server only 11 or 10 digits, 7 or 8), and button pressing which
3. running a query on a third party server via the REST API (the button should be blocked at the moment of the query), to obtain information about the client
4. returns result in json with the number of bonuses or 404, which means this client is not in the system
5. The result of the response from the server, display information in a modal window on the number of bonuses or the text "Client not found"

P. S. the request will need to be run through the server part, as you will need to store the private key for the service call API

There is a Swagger to test the query

The CURL request to third-party service
curl-X GET "/api/v1/customer/by/phone/?include=bonusInfo" -H "accept: */*" -H "Authorization:"
Variables
– server address
– API token
the phone number

The response from the server
If successful, Code is 200
{
"customerId": 213,
"firstName": "Andrey",
"fullName": "Andrey",
"gender": "male",
"phoneNumber": "",
"bonusInfo": {
"totalAmount": 100
}
}

If thats not available Code – 404
{
"error": "CustomerNotFound",
"message": "CustomerNotFound",
"statusCode": 404
}
17.03.2020 12:33



 Answers freelancers