/extras/object-changes API does not accept object type names, instead requiring ids that are hard to obtain #3525

Closed
opened 2025-12-29 18:29:38 +01:00 by adam · 1 comment
Owner

Originally created by @ctrowat on GitHub (Mar 31, 2020).

Environment

  • Python version: 3.7
  • NetBox version: 2.7.10

When utilizing the API /extras/object-changes there is a parameter changed_object_type that requires you to specify a numeric identifier (such as 47), despite having it's type specified as string, for the object type you want to query. This is inconsistent with the result set returned by this API call which uses a serialized value for the changed_object_type field for each result (such as ipam.ipaddress). This causes a lot of frustration when learning how to use this API and overall "feels" like a bug.

I am not certain but this may be related to issue #3001 which ended with a vague suggestion to open a new issue for "this".

Steps to Reproduce

  1. Make a request to the API endpoint /extras/object-changes/?changed_object_type=ipam.ipaddress

Expected Behavior

Results for changed IP addresses should be returned

Observed Behavior

The following is returned:

{
    "changed_object_type": [
        "Select a valid choice. That choice is not one of the available choices."
    ]
}
Originally created by @ctrowat on GitHub (Mar 31, 2020). ### Environment * Python version: 3.7 * NetBox version: 2.7.10 When utilizing the API `/extras/object-changes` there is a parameter `changed_object_type` that requires you to specify a numeric identifier (such as `47`), despite having it's type specified as `string`, for the object type you want to query. This is inconsistent with the result set returned by this API call which uses a serialized value for the `changed_object_type` field for each result (such as `ipam.ipaddress`). This causes a lot of frustration when learning how to use this API and overall "feels" like a bug. I am not certain but this may be related to issue #3001 which ended with a vague suggestion to open a new issue for "this". ### Steps to Reproduce 1. Make a request to the API endpoint `/extras/object-changes/?changed_object_type=ipam.ipaddress` ### Expected Behavior Results for changed IP addresses should be returned ### Observed Behavior The following is returned: ``` { "changed_object_type": [ "Select a valid choice. That choice is not one of the available choices." ] } ```
adam added the status: acceptedtype: feature labels 2025-12-29 18:29:38 +01:00
adam closed this issue 2025-12-29 18:29:38 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 24, 2020):

I've re-raised this as #4897 with an expanded scope.

@jeremystretch commented on GitHub (Jul 24, 2020): I've re-raised this as #4897 with an expanded scope.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3525