Getting started
- Getting started
Introduction
Prerequisite:
checkEligibilityForPortability API requires a Bearer Token. To get this token, you need to follow instructions as described in Authorization part with client credentials flow.
Glossary
Term | Definition |
---|---|
rioCode | The RIO (Relevé d'Identité Opérateur) is a code that used for the portabilty process |
API description
Summary of ressources
Ressource | Definition |
---|---|
check eligibility | Check if incoming portability is allowed |
Summary of operations
There is only one operation available for portabilites.
operation | verb | URL |
---|---|---|
checkEligibilityForPortability | POST | /v1/customer-management/portabilities/check-eligibility |
Details of each operation
operationId : checkEligibilityForPortability
Description
-
This API allow to :
- Check if the portabilty is allowed
-
The repository is updated monthly.
Securing the operation
- Secured with client credentials flow
checkEligibilityForPortability API requires a Bearer Token. To get this token, you need to follow instructions as described in Authorization part for client credentials flow.
Technical Parameters
Parameters | Definition |
---|---|
CONTENT-TYPE | application/json |
AUTHORIZATION | Bearer Token => Mandatory |
X-SOURCE | String allowing to identify explicitly the caller (ex: PARTNER_NAME) |
Functional Parameters
Parameters | Definition |
---|---|
phoneNumber | Phone number to be ported String - Mandatory |
rioCode | RIO code of the phone number to be ported RIO a unique identifier (normally 12 characters long) used by mobile network operators to facilitate mobile number portability (MNP). This allows users to retain their mobile telephone number when switching operators. String - Mandatory |
Requests examples
Success case - validated request and eligibility OK
In this example, we send a request with an valid rioCode and phone number. The portability is OK for this phone number.
Request :
curl -X POST -d "{ \"phoneNumber\":\"+33661370915\",\"rioCode\":\"02P261040TOP\"}" http://b-api-env-ap1.adb.dev.euw1.nbyt.fr/v1/customer-management/portabilities/check-eligibility -H "Content-Type: application/json" -H "Authorization: Bearer at-ef003b10-01ec-402c-8719-d5313557df1a" -H "X-Source: PARTNER_NAME"
The API returns a simple response true or false.
Response :
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"eligibleForPortability": true
}
Success case - validated request but the rioCode is a Bouygues Telecom RIO or phone number already in Bouygues Telecom
In this example, we send a request with an Bougues Telecom rioCode or Bouygues Telecom phone number. The portability is KO for this phone number because the rioCode is a Bougygues Telecom RIO or the phone number already in Bouygues Telecom.
Request - Bougues Telecom rioCode :
curl -X POST -d "{ \"phoneNumber\":\"+33661370915\",\"rioCode\":\"03P261040TOP\"}" http://b-api-env-ap1.adb.dev.euw1.nbyt.fr/v1/customer-management/portabilities/check-eligibility -H "Content-Type: application/json" -H "Authorization: Bearer at-ef003b10-01ec-402c-8719-d5313557df1a" -H "X-Source: PARTNER_NAME"
The API returns a simple response true or false with ineligibilityMessage.
Response :
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"eligibleForPortability": false,
"ineligibilityMessage": "UNAUTHORIZED_PORTABILITY_REQUEST"
}
Success case - validated request but an elegibilty request already in progress
In this example, we send a request with an valid rioCode and phone number. The portability is KO for this phone number because an eligibility is already in progress.
Request :
curl -X POST -d "{ \"phoneNumber\":\"+33661370915\",\"rioCode\":\"03P261040TOP\"}" http://b-api-env-ap1.adb.dev.euw1.nbyt.fr/v1/customer-management/portabilities/check-eligibility -H "Content-Type: application/json" -H "Authorization: Bearer at-ef003b10-01ec-402c-8719-d5313557df1a" -H "X-Source: PARTNER_NAME"
The API returns a simple response true or false with ineligibilityMessage.
Response :
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"eligibleForPortability": false,
"ineligibilityMessage": "IN_PROGRESS_PORTABILITY_REQUEST"
}
Error 400 - case - Invalid Format
The case below shows a KO because the rio code or phone number dont have a valid format.
Request :
curl -X POST -d "{ \"phoneNumber\":\"661370915\",\"rioCode\":\"03P261040TOP\"}" http://b-api-env-ap1.adb.dev.euw1.nbyt.fr/v1/customer-management/portabilities/check-eligibility -H "Content-Type: application/json" -H "Authorization: Bearer at-ef003b10-01ec-402c-8719-d5313557df1a" -H "X-Source: PARTNER_NAME"
Response :
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
{
"error": "INVALID_FORMAT",
"error_description": "Le format des champs phoneNumber est incorrect."
}
Document history
Version | Modification Date | Updates | API concerned | API version |
---|---|---|---|---|
0.1 | 24/11/2021 | Initialization of the document | checkEligibilityForPortability | v1 |