Skip to content
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

Issue/Help with "Update Element for Associations (v3.0)" #757

Open
thedrsadvocate opened this issue Oct 17, 2024 · 1 comment
Open

Issue/Help with "Update Element for Associations (v3.0)" #757

thedrsadvocate opened this issue Oct 17, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@thedrsadvocate
Copy link

Documentation link

https://pan.dev/sdwan/api/put-sdwan-v-3-0-api-elements-element-id/

Describe the problem

When passing in the "Required" values in the body (which is only labeled as site_id being required) and passing in the values into the body that I would like to update, I continue to get a "INVALID_JSON_INPUT" "Input JSON does not have all required attributes".

Here is my JSON body I'm trying to pass:
{
"name":"test-api",
"site_id":"############"
}
(the site_id is filled out with the real values in my API call)

Suggested fix

The documentation should be updated to reflect all of the true required values, as the site_id is clearly not the only one that is required.

@thedrsadvocate thedrsadvocate added the documentation Improvements or additions to documentation label Oct 17, 2024
@thedrsadvocate
Copy link
Author

thedrsadvocate commented Oct 21, 2024

I've now tested in both Python code and Postman with the same error. The above initial issue is via postman.

I copy/pasted the Python code exactly from the documentation and removed the payload items I do not need to modify. Again, it appears that "site_id" is not the only required element as stated in the docs:

import requests
import json

url = "https://api.sase.paloaltonetworks.com/sdwan/v3.1/api/elements/:element_id"

payload = json.dumps({
"name": "string",
"site_id": "string",
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

I should note that I also have a 'Authorization' in the header as well with my bearer token. I can confirm that GET requests work fine, but PUT is where the issue lies. So I can rule out authentication issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant