cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
837
Views
2
Helpful
2
Replies

DNAC API - Get Membership issues

thisd00d
Level 1
Level 1

Hi,
I am attempting to retrieve a list from DNAC with devices assigned to specific sites.
The Get Membership API documentation states that the device information should be returned with this call. However, the data retrieved with this call never returns the device information. This is regardless of whether I'm trying to retrieve the data from our own physical DNAC appliance or one of the cloud instances (dcloud, sandbox). Only site information is returned.

DNAC version: 2.3.3.7

2 Replies 2

Mark Elsen
Hall of Fame
Hall of Fame

 

 - Could you try this  : GET /dna/intent/api/v1/site-membership?siteId=1234567890&includeDeviceInfo=true

 M.



-- Let everything happen to you  
       Beauty and terror
      Just keep going    
       No feeling is final
Reiner Maria Rilke (1899)

The fault was in my own code. Your reply helped me look closer.

def get_site_devices(headers, site_id):
    response = requests.get(BASE_URL + MEMBERSHIP_SITE_URL.format(site_id=site_id), headers=headers, verify=False)
    return response.json()['site']['response']

I was returning the response and selecting ['site'] in the json output. By just writing the line as return response.json() shows the device info as expected.

Thank you for your time.