Skip to main content
Question

API Endpoint publisher

  • October 24, 2025
  • 6 replies
  • 49 views

Timo
Forum|alt.badge.img+1

When running a query against “/api/v2/infrastructure/publishers” the list of to be returned fields can be attached. 

However it seems that only fields from the first level of the JSON can be selected.

 

Does anyone know, if other fields e.g. assessment[latency], can be referenced in the field-list as well? And how?

 

Thanks Timo

6 replies

notskope
  • New Member III
  • October 24, 2025

Not sure what you mean,

What are you using to query the API?

 

If the fields are being returned to you, you should be able to use them how you see fit.


Timo
Forum|alt.badge.img+1
  • Author
  • New Member
  • October 28, 2025

Hello Notskope,

I guess so too. However, as those are arrays the syntax might be slightly different.

 

Right now, I’m just using the Swagger UI from the tenant. Later on, it will most likely be something like curl.

 

BR Timo


notskope
  • New Member III
  • October 28, 2025

Well, ultimately how you access the object depends on the language you are using.

 

For Python it’s pretty easy. Consider the example JSON:

{
"data": {
"publishers": [
{
"apps_count": 3,
"assessment": {
"ca_certs_status": {
"hashes": [
"hash",
"hash"
],
"last_modified": 0
},
"eee_support": true,
"hdd_free": "12345678Kb",
"hdd_total": "123456789Kb",
"host_os_version": "Ubuntu 22.04.5 LTS",
"ip_address": "192.168.10.1",
"latency": 23,
"nonat": false,
"retrans": 889,
"version": "130.0.0.10218"
},
"capabilities": {
"DTLS": false,
"EEE": true,
"auto_upgrade": true,
"nwa_ba": false,
"pull_nsconfig": {
"orgkey_exist": true,
"orguri_exist": true
}
},
"common_name": "some-string",
"connected_apps": ["app1","app2","app3"],
"lbrokerconnect": false,
"publisher_id": 10,
"publisher_name": "EXAMPLE Publisher",
"publisher_upgrade_profiles_external_id": 1,
"registered": true,
"status": "connected",
"stitcher_id": 385,
"stitcher_pop": "US-ATL1",
"tags": [],
"upgrade_failed_reason": {
"detail": "",
"error_code": 0,
"timestamp": 1760765774,
"version": "10218"
},
"upgrade_request": false,
"upgrade_status": {
"upstat": "done"
}
}
]
}
}

 You can easily access the latency value by calling the get method on the dict objects in the JSON.

Assuming the above file is stored in publisher.json a script would look something like this:

import json

with open("publisher.json", "r") as publisher_file:
publisher_info = json.loads(publisher_file.read())
for publisher in publisher_info.get("data").get("publishers"):
print(
f"{publisher.get("publisher_name")} latency : {publisher.get("assessment").get("latency")}"
)

 

The output will be:

EXAMPLE Publisher latency : 23

 


notskope
  • New Member III
  • October 28, 2025

If you have publisher information downloaded to a file named publiser.json, it’s fairly simple to extract the latency of your publishers with a script like this:

#! python3

import json

with open("publisher.json", "r") as publisher_file:
publisher_info = json.loads(publisher_file.read())
for publisher in publisher_info.get("data").get("publishers"):
print(
f"{publisher.get("publisher_name")} latency : {publisher.get("assessment").get("latency")}"
)

Ultimately, whatever language you choose determines how easy it is to extract the data. 

If your publisher’s name is EXAMPLE Publisher and it’s latency is 23 the snippet above will print:

“EXAMPLE Publisher latency : 23”


Timo
Forum|alt.badge.img+1
  • Author
  • New Member
  • November 6, 2025

Thanks from all your replies.

 

What I understand from them, there is no way to filter down the answer without storing the data previously.

The SwaggerUI indicates that the return field can be pre-selected, however this does not seem to apply to the ones being an array or part of one.

 

BR Timo


notskope
  • New Member III
  • November 6, 2025

Ah, I misunderstood your question.

 

I don’t know of any way to do what you are asking. I don’t have the need to limit the returned fields returned from the API and there is no real API documentation.