10-05-2018 01:50 AM
1. I have access to my customer SNTC portal.
2. I have been granted as both customer user and API developer.
3. I have added csapi-customer api to my application
4. When I request a token with postman using clients & client secret from my application -it works
5. when I do a get from postman to https://apx.cisco.com/cs/api/v1/customer-info/customer-details/ with my bearer token
I says 403 permission denied.
What is wrong? Could this be because of missing contract access on my cco account?
When using the product info api it works perfect.
Best regards Steffen Webb
Solved! Go to Solution.
10-08-2018 04:32 AM
Good Morning Steffen,
We will reach out to you offline to validate the credentials and assist you with this issue.
Thanks,
Hernani Crespi
10-08-2018 04:32 AM
Good Morning Steffen,
We will reach out to you offline to validate the credentials and assist you with this issue.
Thanks,
Hernani Crespi
06-14-2019 08:00 PM
01-06-2020 10:22 AM
I'm having this very same issue, and have developer api access. I've created the application in Mulesoft and got ID's for customer and inventory api's. I can get a token, but just like everyone else, when I attempt to get the customer data, it returns a 403 error. The program returns the same.
Can anyone help?
Thanks,
Lon.
02-11-2021 07:17 AM
Hello @Hernani Crespi Di Palma I see that you have helped @arionl resolve his issue of getting empty data set ({data[];}) I am getting the same thing with success 200 when i try to use customerId to get contract details, can you please help me with this. I see you have explained him about some "sync issue between the Mulesoft platform for his Cisco ID" but i do not understand what it is or how to solve, please help
01-21-2019 10:53 AM
I'm having a similar problem. I don't get a 403 error, I get a 200 response but an empty set ('[]') for customer details. My app is registered, it has access to 'csapi-customer' and I'm using 'client credentials' for auth. My user account has all of the appropriate roles in SNTC (APIDeveloper, CustomerAdmin, CustomerUser). I can see data in SNTC fine. Not sure what else to try! Anyone face a similar issue? What am I missing?
01-22-2019 01:36 AM
@arionl wrote:
I'm having a similar problem. I don't get a 403 error, I get a 200 response but an empty set ('[]') for customer details. My app is registered, it has access to 'csapi-customer' and I'm using 'client credentials' for auth. My user account has all of the appropriate roles in SNTC (APIDeveloper, CustomerAdmin, CustomerUser). I can see data in SNTC fine. Not sure what else to try! Anyone face a similar issue? What am I missing?
Hi Arionl
I first get my token with this link (using my clientid and secret from my app registration):
https://cloudsso.cisco.com/as/token.oauth2?grant_type=client_credentials&client_id={{CLIENTID}}&client_secret={{CLIENTSECRET}}
Then I call (with the token provided from oauth2 request)
https://apx.cisco.com/cs/api/v1/customer-info/customer-details?access_token={{token}}
Output with status 200=OK is get as list of customers i have access to.
If you don't get the same result with token as I did, try to delete the app, and create it again and add csapi-customer + csapi-inventory. http://cs.co/apiplatform
Best regards Steffen
01-22-2019 06:08 AM - edited 01-22-2019 06:09 AM
Thanks for the reply. I tried these steps but I'm still getting the same results. My API calls seem to work fine (so the token is OK). I can even see the successful 200 requests in the API dashboard screen.. I'm just not getting any results from the 'customer-details' call. I'm using some sample Python code I found (can't remember where). Below is the relevant snippet. Any assistance would be appreciated.
Thanks,
Arion
import os
import requests
class CiscoSerial(object):
def __init__(self):
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
client_id = os.getenv('client_id')
client_secret = os.getenv('client_secret')
data = [
('client_id', client_id),
('client_secret', client_secret),
('grant_type', 'client_credentials'),
]
r = requests.post('https://cloudsso.cisco.com/as/token.oauth2', headers=headers, data=data, verify=False)
json_data = r.json()
print(json_data)
self.bearer_token = json_data['access_token']
def get_customer_details(self):
get_headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {}'.format(self.bearer_token),
'Access-Control-Allow-Origin': '*'}
output = requests.get('https://apx.cisco.com/cs/api/v1/customer-info/customer-details',
headers=get_headers, verify=True)
return output
if __name__ == '__main__':
lookup = CiscoSerial()
data = lookup.get_customer_details()
if data.status_code >= 200 and data.status_code < 400:
print(data.headers)
print("{} - {}".format(data.status_code,data.reason))
print(data.json())
else:
print(data.headers)
print("{} - {}".format(data.status_code,data.reason))
01-22-2019 06:12 AM
Thanks for the reply. I tried deleting and recreating the app but I'm still getting the same results. The API calls are all successful (returning 200 codes) but I'm just not getting any results from 'customer-details'. Any ideas? I tried to post a code snippet but my message then got marked as SPAM :(
01-22-2019 06:23 AM
Actually, I got your snippet code, and just tried it with success. So the python code works.
It must be some permissions or relationship with your cco account maybe.
01-22-2019 06:37 AM
Thanks. I'll reach out to my Cisco account team and see if they can sort it out.. Glad the code and approach is solid though. Hoping to get this access in place soon so I can do some reconciliation of SNTC with our internal CMDB..
01-22-2019 07:15 AM
Try to write Hernani from cisco whi helped me in this thread :)
01-22-2019 03:21 PM
Just closing the loop here -- Hernani was able to help me get this sorted out.. apparently there was a sync issue between the Mulesoft platform for my Cisco ID.. after correcting it everything is working as expected. Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide