Skip to content

Unable to reference object id in site using REST API  #16011

Closed
@rodvand

Description

@rodvand

Deployment Type

Self-hosted

NetBox Version

v4.0.0

Python Version

3.10

Steps to Reproduce

  1. Create a tenant named "Test Tenant". Make a note of the tenant's id (in my case it's 7)
  2. Create a site using REST API
curl -s -X POST \
-H "Authorization: Token 0123456789abcdef0123456789abcdef01234567" \
-H "Content-Type: application/json" \
http://localhost:32768/api/dcim/sites/ \
--data '{"name": "Test site 1", "slug": "test-site-1", "tenant": 7}' | jq '.'

Expected Behavior

The site is created in and tenant is set to Test tenant.

Observed Behavior

{
  "tenant": {
    "non_field_errors": [
      "Invalid data. Expected a dictionary, but got int."
    ]
  }
}

The same API calls work as expected in NetBox 3.7.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions