Skip to main content

How to retrieve Network Logs via the API?

Query the /network-logs endpoint to fetch the data.

Jakub Kubinski avatar
Written by Jakub Kubinski
Updated over 3 weeks ago

Environment

Question

  • How to retrieve Network Logs via the API?

  • Which parameters to use if I want to pull historic Network Logs?

Answer

Query the /network-logs endpoint to fetch the data.

  1. Create a new API key or use an existing one.

  2. Pick a timestamp you are interested in.

  3. Send a request to api.onomondo.com/network-logs/{sim_id}, including:

    1. timestamp (mandatory),

    2. order (optional),

    3. limit (optional),

    4. offset (optional).

Example request:

curl -L \
--url 'https://api.onomondo.com/network-logs/{sim_id}?timestamp=...' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Accept: */*'

Note:

  • timestamp is a mandatory parameter.

  • timestamp must follow this format: 2022-08-19T00:00:00.000Z.

  • It is recommended to include the order parameter as well.

  • The order parameter is used to specify whether the API should return logs generated before or since the time defined in the timestamp. For example:

    • order=DESC - returns up to 1000 logs generated before the timestamp

    • order=ASC - returns up to 1000 logs generated since the timestamp

  • If order is unspecified, the API will return logs in descending (DESC) order.

See our API documentation for additional information:

Did this answer your question?