cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Cisco announces new innovations in SD-WAN, ISRs, SD-WAN Services, and Catalyst 9000 Series switches


602
Views
0
Helpful
1
Replies
dal Participant
Participant

ISE v2.0 Guest Rest API - errors when trying to create Guest user

Hi.
I have a script made in Postman for Chrome that I plan to use for making guest users.
In ISE v1.3 it worked fine, but not in v2.0

I have made changes to the script according to the new versjon of the API, but it still does not work.

The script looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:guestuser xmlns:ers="ers.ise.cisco.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns4="identity.ers.ise.cisco.com">
     <customFields>
     </customFields>
     <guestAccessInfo>
        <fromDate>18/11/2015 23:22</fromDate>
        <toDate>19/11/2015 23:22</toDate>
        <location>Lokasjon</location>
        <validDays>5</validDays>
        </guestAccessInfo>
    <guestInfo>
        <enabled>true</enabled>
        <phoneNumber>12345678</phoneNumber>
        <smsServiceProvider>Intern_NowSMS</smsServiceProvider>
        <userName>12345678</userName>
    </guestInfo>
    <guestType>Access</guestType>
    <portalId>c89ae400-5deb-11e5-8a02-88f0312797f8</portalId>
</ns4:guestuser>

When I try to run it, I get this error:
<title>XML Schema Validation Failed :: at line 8, column 19 : cvc-complex-type.2.4.a: Invalid content was found starting with element 'location'. One of '{validDays}' is expected.</title>

When I move <validDays> one line up, I get this error:
<title>XML Schema Validation Failed :: at line 9, column 19 : cvc-complex-type.2.4.d: Invalid content was found starting with element 'location'. No child element is expected at this point.</title>

And of course, if I try to remove <location> (or fromDate or toDate), I get this error:
<title>Validation Error - Mandatory fields missing: [location]</title>

So, a classical Catch22


Seems like a bug to me. Or am I doing something wrong?

Thanks.

1 REPLY

Hi Dal,

Hi Dal,

You are correct, it is a bug that appeared in 2.0. Like you I ran into this problem and the bug is specified here (CSCux39158) in Ciscos Bug Search-tool. The solution is to use the correct order in the XML-scheme but they fail to specify what the correct order is... Fortunately I've discovered it through trial and error and here it is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:guestuser xmlns:ns3="identity.ers.ise.cisco.com">
<customFields>
</customFields>
<guestAccessInfo>
<fromDate></fromDate>
<location></location>
<toDate></toDate>
<validDays></validDays>
</guestAccessInfo>
<guestInfo>
<company></company>
<emailAddress></emailAddress>
<firstName></firstName>
<lastName></lastName>
<notificationLanguage></notificationLanguage>
<phoneNumber></phoneNumber>
<smsServiceProvider></smsServiceProvider>
<userName></userName>
</guestInfo>
<guestType></guestType>
<personBeingVisited></personBeingVisited>
<portalId></portalId>
<reasonForVisit></reasonForVisit>
</ns3:guestuser>

I hope this is helpful for you!

CreatePlease to create content
Ask the Expert- Introduction to Network Design