porting_logs
porting_logs returns the history of porting events recorded
for a phone number: each time it moved to another operator, and each time
it went back to the operator that originally held its number range.
porting_logs or porting_timestamp?
Both commands are about porting, but they answer different questions:
porting_timestamp | porting_logs | |
|---|---|---|
| Question it answers | Has the number been ported, and when was the last port? | Which porting events are recorded for the number? |
| Response | Three fields: ported, ported_date,
ported_date_type |
A list, porting_logs, one entry per event |
| Number never ported | An answer: ported: false, charged |
No porting_logs field, status: 4, not
charged |
| Direction of each move | Not given | Given: ported away (A) or returned
(D) |
| Destination operator | Not given (use current_carrier) |
Given for each event, as a network identifier |
To know whether a number was ported, use porting_timestamp:
it is the only one of the two that answers "never ported" explicitly.
Use porting_logs when you need the sequence of events.
Request
Send the number and porting_logs in commands.
No other input is needed.
{
"number": "+40766610123",
"commands": ["porting_logs"]
}
porting_logs is not available in every country. Where it
is not available, see Billing.
Response
{
"status": 0,
"status_message": "Response from one supplier",
"porting_logs": [
{
"plmnetwork": 0,
"i_type": "m",
"action": "D",
"ts": "2024-03-01T10:00:00.000Z"
},
{
"plmnetwork": 1234,
"i_type": "m",
"action": "A",
"ts": "2022-12-19T08:30:00.000Z"
}
],
"version": "..."
}
| Field | Type | Meaning |
|---|---|---|
action |
string | The kind of event. See the table below. |
plmnetwork |
integer | An identifier of the operator the number moved to.
0 when the number went back to the operator that
holds its number range (action: D). The identifier
is stable, so you can compare events, but it is not a name: use
current_carrier for the name of the operator the
number is on today. |
i_type |
string | The kind of number: m mobile, f
fixed, o other. |
ts |
string | When the event was recorded, ISO 8601 in UTC, for example
2022-12-19T08:30:00.000Z. |
action values
| Value | Meaning |
|---|---|
A | Ported to an operator other than the one that holds the number range. |
D | Returned to the operator that holds the number range. plmnetwork is 0. |
The history covers the events recorded since the data for the number's
country became available, so very old ports may be missing. Do not
assume the list is sorted: order the events by ts before
reading the most recent one. Treat values not listed here as unknown.
When there is no porting_logs field
If no porting event is recorded for the number, if the source has no
porting data for it, or if it could not be reached, the response has no
porting_logs field. An empty list is never returned. The
status is 4, and the
status_message names porting_logs among the
commands that returned no data. If the number's country is not covered,
the status is 2, or 4 when other
commands were served.
Billing
A response with a porting_logs list is charged. A response
without it, including a number with no recorded porting event, is not
charged.