Legacy Rest API > Rest API2 – Customer Migration Documentation (Exported on 10/11/2023)
Endpoint URL Changes
In the legacy version, endpoints were named with just a version number. To improve understanding of the endpoints, the names will be changed to reference either the function or the data that is particular to that request. Additionally, the domain has been changed.
This table shows the following:
HTTP Method
Previously, most endpoints used GET, and these will still be available in the legacy version. The new version will use POST with one exception (see Method and Content-Type Mapping).
Content-Type
Previously, the Content-Type varied across endpoints.
The new version will require the Content-Type: application/json header.
Authorization
Previously, an authorization token would be passed along with the data. The standard, however, is to pass it in the Authorization header.
All the POST endpoints in the new version that require authorization will require this header.
The token will be passed with a Bearer authorization type.
Example
If previously we had
curl -X GET “https://validate.bankersalmanac.com/validate-api/rest/convert/
1.0.1?countryCode=GB&nationalId=201433&errorComment=E&token={token}”
then we would use
curl -X POST “https://api.validate.bankersalmanac.com/validation” \
-H “Content-Type: application/json” -H “Authorization: Bearer {token}” \
–data-raw ‘{“countryCode”:”GB”,”nationalId”:”201433″,”errorComment”:”E”}’
Trailing Slashes
Previously, trailing slashes were interpreted as different paths.
In the new version, trailing slashes will be ignored.
For example, /validation// will be interpreted as /validation.
Unknown Fields
There are times where fields are provided in a request which are not used due to typos. To mitigate this
confusion, if unknown fields are provided in the endpoints of the new version, the HTTP status will be 400 Bad Request.
Method and Content-Type Mapping
Some endpoints are using POST in the legacy version already, but they will still need to be migrated from
content type x-www-form-url encoded to application/json .
This table shows how all the endpoints map:
Path | Legacy HTTP Method | Legacy Content-Type | New HTTP Method | New Content-type |
/authenticate | POST | x-www-form-urlencoded | POST | application/json |
/validation | GET | N/A (query parameters) | POST | application/json |
/validation | POST | x-www-form-urlencoded | POST | application/json |
/safe-payment-verification | GET | N/A (query parameters) | POST | application/json |
/safe-payment-verification | POST | application/json | POST | application/json |
/4.6.2 | POST | x-www-form-urlencoded | POST | application/json |
/actuator/health | N/A | N/A | GET | N/A |
every other endpoint | GET | N/A (query parameters) | POST | application/json |