Skip to content

Customer Site

The Customer Site endpoints provide the ability to store location information for each OAID, such as the site's coordinates and postal address.

Requirement: Relation Name

To create a site for an OAID, the relation between the involved PIP and ANO must be defined as a relation_name. Please store the relation data using the "Create Infra Relation" endpoint.

Create Customer Site

Location details for an OAID can be entered at the "Assign/Create Site" endpoint. This PUT method requires the oaid to be appended to the base URL as a path parameter.

The required attributes to submit in the request body are:

  • "token" - set to either "construction" or "operation"
  • "relation_names" - a list of relation names for each PIP-ANO relation involved
  • "center" - the coordinates of the customer site
$ curl --request PUT "https://api.oaid.at/v2/pip/sites/AB1C23E4/" \
$  --header "Authorization: Bearer <access_token>" \
$  --header "Accept: application/json" \
$  --header "Content-Type: application/json" \
$  --data '{
        "token": "operation", 
        "relation_names": [
            "con_moorland", 
            "wholesale212"
        ], 
        "center": "48.20854733,16.37295900"
}'
---> 100%
{
    "oaid": "AB1C23E4",
    "customer_reference": "loc01212-2442346",
    "token": "operation",
    "relation_names": [
        "con_moorland",
        "wholesale212"
    ],
    "status": "active",
    "address_reference": {
                "agwr_adr": "7654321-001",
                "agwr_obj": "0006543",
                "usr": "sdf-245-q3e"
    },
    "address": {
        "country": "AT",
        "zip": "4322",
        "city": "Flake",
        "street": "Maria Theresia Straße",
        "hnr": "13/a",
        "door": "2",
        "addon": "left entrance"
    },
    "lot_id": "04321:16/2",
    "center": "48.20854733,16.37295900",
    "created_at": "2019-05-29T17:11:14.206+00:00",
    "modified_at": "2021-04-12T13:03:07.566+00:00"
}

Read Specific Site

Data about one site can be obtained by calling the GET method "Read Customer Site" endpoint and adding the specific oaid as a path parameter.

$ curl --request GET "https://api.oaid.at/v2/pip/sites/AB1C23E4/" \
$  --header "Authorization: Bearer <access_token>" \
$  --header "Accept: application/json" 
---> 100%
{
    "oaid": "AB1C23E4",
    "customer_reference": "loc01212-2442346",
    "token": "construction",
    "relation_names": [
        "con_moorland",
        "wholesale212"
    ],
    "status": "active",
    "address_reference": {
                "agwr_adr": "7654321-001",
                "agwr_obj": "0006543",
                "usr": "sdf-245-q3e"
    },
    "address": {
        "country": "AT",
        "zip": "4322",
        "city": "Flake",
        "street": "Maria Theresia Straße",
        "hnr": "13/a",
        "door": "2",
        "addon": "left entrance"
    },
    "lot_id": "04321:16/2",
    "center": "48.20854733,16.37295900",
    "created_at": "2019-05-29T17:11:14.206+00:00",
    "modified_at": "2021-04-12T13:03:07.566+00:00",
    "partners": [
      {
         "relation_name": "con_moorland",
         "pip": {
                "company_name": "fiberpark gmbh", 
                "rtr_agg_id": 412,
                "phone": "+43-1-987654321", 
                "email_to": "support@my-own-domain.at", 
                "pip_code": "fiber.pip"
        },
         "ano": {
                "company_name": "fiberpark gmbh",
                "rtr_agg_id": 413,
                "phone": "+43-1-987654321",
                "email_to": "support@my-own-domain.at",
                "ano_code": "fiber.ano"
        },
         "pip_url": "https://httpbin.org/get?oaid=AB1C23E4&center=48.20854733,16.37295900&customer_reference=loc01212-2442346&pip_code=fiber.pip"
      },
      {
         "relation_name": "wholesale212",
         "pip": {
                "company_name": "fiberpark gmbh", 
                "rtr_agg_id": 412,
                "phone": "+43-1-987654321", 
                "email_to": "support@my-own-domain.at", 
                "pip_code": "fiber.pip"
        },
         "ano": {
                "company_name": "fiberpark gmbh",
                "rtr_agg_id": 413,
                "phone": "+43-1-987654321",
                "email_to": "support@my-own-domain.at",
                "ano_code": "fiber.ano"
        },
         "pip_url": "https://httpbin.org/get?oaid=AB1C23E4&center=48.20854733,16.37295900&customer_reference=loc01212-2442346&pip_code=fiber.pip"
      }
  ]
}

Read List of Sites

A list of sites can be read via the "List Customer Sites" endpoint.

The endpoint provides two filter parameters:

  • token - set to "construction" or "operation"
  • relation_name - a unique relationship identifier between an ANO and a PIP

By default, the API limits the number of records per request to 500. To read all sites, you have to use multiple requests to get all pages of records.

Pagination

This endpoint uses No Offset Pagination (or Cursor Pagination). To control pagination, two further query parameters are available:

  • _page_cursor - a unique ID marking the starting point for the next page (defined in the next URL)
  • _page_size - optional, the number of records to receive per page (default: 500, max: 2000)

Below are step-by-step instructions for retrieving all records, followed by a script in Python to automate pagination.

  1. Request the First Page

    In the first page request simply use the base url (plus an optional _page_size query parameter if required).

    $ curl --request GET "https://api.oaid.at/v2/pip/sites/?_page_size=500" \
    $  --header "Authorization: Bearer <access_token>" \
    $  --header "Accept: application/json" 
    ---> 100%
    
    HTTP/1.1 200 OK
    date: Thu, 27 Mar 2025 19:25:35 GMT
    ...
    x-page-size: 500
    x-page-count: 163
    link: <https://api.oaid.at/v2/pip/sites/?_page_size=500>; rel=self, <https://api.oaid.at/v2/pip/sites/?_page_cursor=01953216-aaaa-788e-986e-822e157e5114&_page_size=500>; rel=next
    
    [
      {"oaid": "AB1C23E4", ...
      {"oaid": "AC4723E7", ...
      ...
    ]
    

  2. Retrieve the next URL

    The next URL for pagination is provided in the API response header in the link field. The method for extracting the next URL varies depending on the programming language used. The Link header is common implementation for pagination.

    For instance, in the Python script below, we use the httpx package, which parses the links from the response header and stores them in the response.links object. If another page is available to retrieve, it will include a "next" object with the relevant "url" value for accessing the next page:

    next_url = response.links.get("next", {}).get("url")
    
  3. Request Next Page

    Use the next_url obtained in Step 2 in your next request:

    request GET "https://api.oaid.at/v2/pip/sites/?_page_cursor=01953216-aaaa-788e-986e-822e157e5114&_page_size=500"                
    
  4. Repeat Until Completion

    Repeat Steps 2 and 3 until no next URL is provided or the last page returns an empty page of data ([]), indicating all records have been retrieved.

Example Script for Python

The following script automates pagination to fetch all pages of data. Please replace the <client_id> and <client_secret> placeholders with your credentials.

# /// Pagination Script
# requires-python = ">=3.11"
# dependencies = [
#     "httpx",
#     "httpx-auth"
# ]
# ///

import httpx
from httpx_auth import OAuth2ClientCredentials

BASE_URL = "https://api.oaid.at/v2/pip/sites/"

oauth2_cred = OAuth2ClientCredentials(
    token_url="<token_url>",            # use provided token url
    client_id="<client_id>",            # fill in your client id
    client_secret="<client_secret>",    # fill in your client secret
    scope="read"                     
)

results_list = []
next_url = BASE_URL

with httpx.Client(headers={"Content-Type": "application/json"}, auth=oauth2_cred) as client:
    while next_url:
        response = client.get(url=next_url)
        results_list.extend(response.json())
        next_url = response.links.get("next", {}).get("url")

print(f"Total records: {len(results_list)}")

Update Customer Site

Customer sites can be updated on an OAID by providing the oaid in the URL path when calling the "Update Customer Site" endpoint.

$ curl --request PATCH "https://api.oaid.at/v2/pip/sites/AB1C23E4/" \
$    --header "Authorization: Bearer &lt;access_token&gt;" \
$    --header "Accept: application/json" \
$    --header "Content-Type: application/json" \
$    --data '{"center": "48.3,16.2", "token": "operation"}'
---> 100%
{
    "oaid": "AB1C23E4",
    "customer_reference": "loc01212-2442346",
    "token": "operation",
    "relation_names": [
        "con_moorland",
        "wholesale212"
    ],
    "status": "active",
    "address_reference": {
                "agwr_adr": "7654321-001",
                "agwr_obj": "0006543",
                "usr": "sdf-245-q3e"
    },
    "address": {
        "country": "AT",
        "zip": "4322",
        "city": "Flake",
        "street": "Maria Theresia Straße",
        "hnr": "13/a",
        "door": "2",
        "addon": "left entrance"
    },
    "lot_id": "04321:16/2",
    "center": "48.3,16.2",
    "created_at": "2019-05-29T17:11:14.206+00:00",
    "modified_at": "2021-04-12T13:03:07.566+00:00"
}

Remove Customer Site

Request the removal of the customer site for an OAID from the "Remove Customer Site" endpoint. Provide the oaid to be removed as a path parameter.

$ curl --request DELETE "https://api.oaid.at/v2/pip/sites/AB1C23E4/"  \
$  --header "Authorization: Bearer &lt;access_token&gt;" \
$  --header "Accept: application/json" 
---> 100%

HTTP/1.1 204 No Content
Content-Type: application/json
Date: Sun, 12 Apr 2021 17:32:16 GMT
Server: uvicorn

&lt;Response body is empty&gt;

Response code: 204 (No Content); Time: 122ms (122 ms); Content length: 0 bytes (0 B)