Skip to content

Extend REST API documentation with an example of uploading an image attachment using curl #17243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeremystretch opened this issue Aug 22, 2024 · 1 comment · Fixed by #19330
Assignees
Labels
netbox status: accepted This issue has been accepted for implementation type: documentation A change or addition to the documentation
Milestone

Comments

@jeremystretch
Copy link
Member

Change Type

Addition

Area

Integrations/API

Proposed Changes

The process for uploading files via the REST API differs a bit from regular JSON data. A simple copy-and-paste example using curl would be helpful for reference and troubleshooting. For example:

curl -X POST \
-H "Authorization: Token $TOKEN" \
-F "object_type=dcim.site" \
-F "object_id=2" \
-F "name=attachment1.png" \
-F "[email protected]" \
http://netbox:8000/api/extras/image-attachments/
@jeremystretch jeremystretch added type: documentation A change or addition to the documentation status: needs triage This issue is awaiting triage by a maintainer status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: needs triage This issue is awaiting triage by a maintainer labels Aug 22, 2024
@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 25, 2025
@jeremystretch jeremystretch self-assigned this Apr 25, 2025
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation pending closure Requires immediate attention to avoid being closed for inactivity labels Apr 25, 2025
@jnovinger jnovinger added this to the v4.2.9 milestone Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
netbox status: accepted This issue has been accepted for implementation type: documentation A change or addition to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants