cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
675
Views
0
Helpful
1
Replies

FMC API PUT Failing with Access token invalid - Help Needed

All,

I am able to navigate to api-explorer and execute changes on here (having provided domain_uuid, object_id and policy_id). This succeeds and I get a response of 200.

However, when I use the same URL, headers and data (or payload) using a python script via a requst.put request, I get the following error:

{
"error": {
"category": "FRAMEWORK",
"messages": [
{
"description": "Access token invalid."
}
],
"severity": "ERROR"
}
}

Here is what I have for my PUT request (note I am passing parameters into a function that performs the PUT request)

api_uri = "/api/fmc_config/v1/domain/{}/policy/accesspolicies/{}/accessrules/{}".format(kwargs["domain_uuid"], kwargs["this_policy_id"], kwargs["rule_id"])

url = "https://" + kwargs["fmc_ip"] + api_uri

data = dict #this has the policy dict

headers = {
'accept' : 'application/json',
'Content-Type': 'application/json',
'X-auth-access-token': kwargs['access_token']
}

response = requests.put(url,verify=False,headers=headers, data=data).json()

 Any help or thoughts welcome.

Thanks

1 Reply 1

for greater context - i am trying to update access policy rules with additional host object and literals etc...

Review Cisco Networking for a $25 gift card