Post

3 followers Follow
0
Avatar

Updating User license using API

Hi,

 

I want to update the existing user licenses using the API's 

I can able to update the user License as None and Full using API, but when I was trying to update user license to Team Member I am getting the below error,

 

Entity 'Team Member' of type 'LicenseType' was not found.

 

Kindly help me how to resolve this error

 

 

Saiteja Chelluboina Answered

Please sign in to leave a comment.

9 comments

0
Avatar

I do not believe license assignment is part of the API capabilities.

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Hi Josh, I can able to add new user and update all the fields of existing users but when I am trying to update the State field below query, I am getting the error

    method: 'POST',
    body: JSON.stringify({ 
        "UserName": "user name", 
        "Password": "password", 
        
  }),
})
.then(response => response.json())
.then(json => {
    console.log(json);
    return(json.sessionId);
})
.then(value=>
        method: 'POST',
        headers: new Headers({
               'Content-Type': 'application/json',
               'Authorization': 'Session '+value
            }),
        body: JSON.stringify({
                "LicenseType":"none",
                 "State":"suspended"
        }),   
    })
    .then(response => response.json())
    .then(json => console.log(json))
)



Saiteja Chelluboina 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

I can able to assign licenses using API's using the below query could you please confirm if any changes are done in the API's recently,

I can only assign a trail license.Could you please confirm on this? will this work?

    method: 'POST',
    body: JSON.stringify({ 
        "UserName": "", 
        "Password": "", 
        
  }),
})
.then(response => response.json())
.then(json => {
    console.log(json);
    return(json.sessionId);
})
.then(value=>
        method: 'POST',
        headers: new Headers({
               'Content-Type': 'application/json',
               'Authorization': 'Session '+value
            }),
        body: JSON.stringify({
            "entity": {
                "Id": "/User",
                "DisplayName": "apitestuser3",
                "Email": "apitest3@cognizant.com",  
                "LicenseType":"Full",
                "superUser":true,
                "financial":true,
                "SendInvitationMail":false
            },
            "fields": [
                "DisplayName"
            ]
        }),   
    })
    .then(response => response.json())
    .then(json => console.log(json))
)
Saiteja Chelluboina 0 votes
Comment actions Permalink
0
Avatar

Hello Saiteja,

Setting user state via API is not supported. 

License management via API is not supported either. When selecting LicenseType upon user creation, you're not assigning the license directly. The system is doing it based on the LicenseType entered on the user object. I tested this in my demo environment and the system is also assigning trial license upon user creation. I don't think there's a way around this behaviour.

I hope this answers your question.

Roland

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

Thanks for your response.

let say we have assigned a trial license to a user via API. As per our understanding user can access Clarizen even if user assigned trial license. once the trial license got expired after a month, Will Clarizen assign license from available non trial licenses from the Clarizen system?

 

Saiteja Chelluboina 0 votes
Comment actions Permalink
0
Avatar

Hello Saiteja,

I think the system will assign a license of the same type if one is available.

I hope this answers your question.

Roland

Roland Pumputis 0 votes
Comment actions Permalink
1
Avatar

Note: The user has to log in during the trial period for a new license to be assigned.

Roland Pumputis 1 vote
Comment actions Permalink
0
Avatar

Hi Roland,

Thanks for your response, 

could you please help us out in below query as well,

We can able to change the permissions of the user i.e., SuperUser, Financial using the below API it is working fine but whenever we are trying to change the permission type as admin we are getting below error. kindly advise here
URL : 'https://api.clarizentb.com/V2.0/services/data/objects/User/6d5c76af-9507-4f01-a73f-ec61a53a3e87'
Body:
"LicenseType":"Full",
"superUser":false,
"financial":false,
"Admin":true
{errorCode: "InvalidOperation", message: "Invalid operation: Field 'Admin' cannot be updated. The field is marked 'read-only'."},

Saiteja Chelluboina 0 votes
Comment actions Permalink
0
Avatar

Hello Saiteja,

As per the error, setting the Admin field via the API is not supported.

Best regards,

Roland

Roland Pumputis 0 votes
Comment actions Permalink