Create POP/Site/Link
In this guide, the process for creating a POP, a site, and for linking the data within the myfiber API is described, with examples for each step.
Overview of the Steps:
- Create POP (creates a POP and returns the 'pop_id')
- Create Site (creates a Site and returns the 'site_id')
- Create Link (uses the 'pop_id' and 'site_id' to link the data together)
Requirement for 'pip_code' field
'pip_code' is a required attribute for these endpoints. It cannot be set arbitrarily, but is assigned to the client in advance via a support ticket.
Step 1: Create POP
First, create the POP (or Point of Presence) using the "Create POP" endpoint.
The required attributes are:
- 'token': either
"planned"
or"built"
- 'pip_code': synonym for the PIP
- 'name': name of the POP
- 'center': the coordinates of the POP
For example, suppose we have a POP that should have the 'token' set to "planned", a 'pip_code' named "example_pip", the 'name' of the pop is "pop_name", and the coordinates for the POP's location are "48.208547,16.372959".
The API request and response looks as follows:
$ curl --request POST --location "https://api.myfiber.at/v2/pip/resource/pops/" \
$ --header "Authorization: Bearer <access_token>" \
$ --header "Accept: application/json" \
$ --header "Content-Type: application/json" \
$ --data '{
"token": "planned",
"pip_code": "example_pip",
"name": "pop_name",
"center": "48.208547,16.372959"
}'
---> 100%
{
"tenant": "fiberpark",
"pop_id": "d43f97fa-471d-4ccb-a649-7a0d755c1d74",
"status": "active",
"token": "planned",
"pip_code": "example_pip",
"name": "pop_name",
"customer_reference": null,
"address": {
"country": "AT",
"zip": "4322",
"city": "Flake",
"street": "Maria Theresia Straße",
"hnr": "13/a",
"obj": "Hause 1"
"door": "2",
"addon": "left entrance"
},
"lot_id": "04321:16/2",
"center": "48.20854700,16.37295900",
"created_at": "2019-05-29T17:11:14.206+00:00",
"modified_at": "2021-04-12T13:03:07.566+00:00",
"_etag": "P4zSJFSiVk9"
}
Entire List of Attributes Located at API Endpoint
The example above displays the data you would receive when entering the minimum required attributes. You can provide more fields when creating or updating the POP. Please refer to the API endpoint for a complete list of attributes.
Keep the pop_id
handy that was just received from the API response; this identifier will be needed later in Step 3.
Step 2: Create Customer Site
Next, store the site information with the "Create Customer Site" endpoint.
A site can be created with the following required attributes:
- 'token': either
"reserved"
,"accepted"
, or"confirmed"
- 'pip_code': the PIP name
- 'center': the coordinates of the site
- 'oaid': (optional) The Open Access ID can be obtained from the OAID Register
For the example below, we've set the 'token' to "accepted", provided the same 'pip' name as in Step 1, set the 'center' coordinates to "48.208555, 16.372966", and used the OAID "ABCD1234".
$ curl --request POST --location "https://api.myfiber.at/v2/pip/resource/sites/" \
$ --header "Authorization: Bearer <access_token>" \
$ --header "Accept: application/json" \
$ --header "Content-Type: application/json" \
$ --data '{
"token": "accepted",
"pip_code": "example_pip",
"center": "48.208555,16.372966",
"oaid": "ABCD1234"
}'
---> 100%
{
"tenant": "fiberpark",
"site_id": "71fbbf5d-07d3-4db1-95f9-246f9524eae2",
"oaid": "ABCD1234",
"pop_id": null,
"status": "active",
"token": "accepted",
"pip_code": "example_pip",
"customer_reference": null,
"link_contracts": null,
"address": {
"country": "AT",
"zip": "4322",
"city": "Flake",
"street": "Maria Theresia Straße",
"hnr": "13/a",
"obj": "Hause 1"
"door": "2",
"addon": "left entrance"
},
"lot_id": "04321:16/2",
"center": "48.20855500,16.37296600",
"created_at": "2019-05-29T17:11:14.206+00:00",
"modified_at": "2021-04-12T13:03:07.566+00:00",
"_etag": "P4zSJFSiVk9"
}
The Site ID we obtained from the response will be used in the request in Step 3.
'pop_id' and 'link_contracts' Fields
The 'pop_id' and 'link_contracts' fields initially return null. Once the site is linked to a POP using the "Create Link" endpoint, these fields will be updated automatically.
Step 3: Create Link
Now, create a link for the site via the "Create Link" endpoint.
The necessary attributes to fill in the request body schema are:
- 'site_id': the site ID (from Step 2)
- 'pop_id': the pop ID (from Step 1)
- 'fiber': a local identifier relative to the specified site_id (OAID)
- 'token': either
"idle"
,"prepared"
,"indelivery"
,"connected"
, or"unclear"
- 'link_contract': the name of the contract
For example, we use the 'site_id' and 'pop_id' from the previous steps, set 'fiber' to "1", 'token' to "prepared", and name the 'link_contract' as "fiber_example":
$ curl --request POST --location "https://api.myfiber.at/v2/pip/resource/links/" \
$ --header "Authorization: Bearer <access_token>" \
$ --header "Accept: application/json" \
$ --header "Content-Type: application/json" \
$ --data '{
"site_id": "71fbbf5d-07d3-4db1-95f9-246f9524eae2",
"pop_id": "d43f97fa-471d-4ccb-a649-7a0d755c1d74",
"fiber": "1",
"token": "prepared",
"link_contract": "fiber_example"
}'
---> 100%
{
"tenant": "fiberpark",
"link_id": "c9d8392b-6a16-429c-abac-0a25e43e6256"
"site_id": "71fbbf5d-07d3-4db1-95f9-246f9524eae2",
"oaid": "ABCD1234",
"fiber": "1",
"status": "active",
"token": "prepared",
"pip_code": "example_pip",
"link_contract": "fiber_example",
"pop_id": "d43f97fa-471d-4ccb-a649-7a0d755c1d74",
"pop_position": [
{
"name": null,
"value": null
}
],
"customer_reference": null,
"created_at": "2019-05-29T17:11:14.206+00:00",
"modified_at": "2021-04-12T13:03:07.566+00:00",
"_etag": "P4zSJFSiVk9"
}