Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Unable to create request through createrequestAPI

Manohar_122
New Contributor
New Contributor

 

We are currently attempting to raise a request using the createrequestAPI in EIC 24.4, but we are encountering a 401 error. Other APIs such as getuserapi and addroleapi are working correctly. Additionally, when performing the same action via the UI for the same user acting as the requestor, the request is successfully created.

Manohar_122_0-1723019446564.pngManohar_122_1-1723019602209.png
Could you please help me on this.

Regards,

Manohar

26 REPLIES 26

pmahalle
All-Star
All-Star

HI @Manohar_122 ,

Looks like user whose token you are using for authorization doesn't have SAV role assigned having appropriate permissions to execute createrequest API.

Assigne ROLE_ADMIN SAV role to user and then generate token and try to execute API.


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

Hi @pmahalle 

Thanks for your reply. We are testing this out with the ROLE_ADMIN SAV role itself but its not working.

Thanks
Manohar

Hi @Manohar_122 

Then check if role which you are trying to request is requestable or not and requestor you are using in your request payload have appropriate sav role with request permissions.


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

Hi @pmahalle 

Yes the role is requestable and requestor we are using in our request in payload also has the ROLE_ADMIN Sav role.

Regards,
Manohar

regenerate the token and validate.


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi @rushikeshvartak 

I did try to regenerate token and use it many times but its the same.
Here are the postman screenshot and curl command

Manohar_122_0-1723033828396.png

 

 


curl command
curl --location 'https://{{URL}}/ECM/api/v5/createrequest' \
--header 'SAVUSERNAME: admin' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTdjA4VVFSajk5anlDOFJJRUUwMHNvQkU2c3hlNXlsd0RuS2ZCckFmaHVBWVR6ZHp1eHpvd083UE96TUpkUTY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jdTd3BiYjFtK1hIbmpiRXFYYVwvZWZ2ZTk5N2Iwd3NZTVJwcXNXWmNHZFJzcTdBS0lBS3krd0hSYW9jallYN2w4dG1sb3RxRzIwOWdMc3BNNGEyKzhkSjI3clYzYjFiVTVLRGo3QUQ1VjdxMGFIc1poelVkengrUXdsQnJybVNacm9qRXhYeGRlN0VpWDh3K2Zuclwvc21nVXdLZ1RKN2VcL2sweGY3d0FnN04zdjZmeW9MM1F3cU9oMVF0WXZaZlNOaE1GODZwR3BcL3o5ZVBuTDBjV250M2RJMlNGZVwvbjhmMFwvTlh5ZlViS2ttWlpsWU5kVVMwMjJYM1RPUUx0NU5mdDlEMzJ6eEpCZElmSlMxR054SUZNZGt0YXlXdTg3WndiMlVwYUw2ZmZcL0Ztc2VWZUs2dFVaSE94OFd6MmVZMjB4M0xycmpNXC9VTlRZM3ErRDhcLzBuUDRqbk5ZeHNNWkVoSlQ5ZWdGcFowa1c5ZTNvMFdUbjh1WmY3eUtYSHZ0WCtBRUhwdkNrWEF3QUEiLCJpc3MiOiJzc20tZGV2LXBtaS5zYXZpeW50Y2xvdWQuY29tIiwic3ViIjoiVGVzdEVJQzEyOTMiLCJleHAiOjE3MjI5MzMyNzUsImlhdCI6MTcyMjkyOTY3NSwicm9sZXMiOlsiUk9MRV9BRE1JTiJdfQ.FeZ3Pb4L9tuf5gi9tFqHmigVGTGe0r9lXqDJedOEiqE; token_type=Bearer; user_name=TestEIC1293' \
--data '{
"accesstype":"ROLES",
"username":"1000676802",
"roletype":"ENTERPRISE",
"requesttype":1,
"roles":[
{
"rolename" : "TEST VIVA ROLE 3",
"startdate" : "08-06-2024",
"enddate" : "10-06-2024",
"businessJustification" : "testjustification"
} ],
"requestcomments":"commemnt",
"requestor":"1000676802"
}'

Regards
Manohar

@Manohar_122 Hope you are passing the username of requestor in payload

"requestor":"1000676802"

Regards,
Sumathi Somala

If this reply answered your question, please Accept As Solution and give Kudos.

Hi @SumathiSomala 

Yes we are passing the username of requestor in payload

Regards,
Manohar

Try with user having sav role as role_admin


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

@rushikeshvartak We are using the role_admin sav role itself.

naveenss
All-Star
All-Star

Hi @Manohar_122 this looks to be a defect for me. I would recommend you to open a ticket with Saviynt support for further troubleshooting.

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Its working for me in v24.7 & 24.4 

validate your subversion


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Its not working for me on v24.4

Whats your subversion


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

This is working when i disable the OAuth and not working when its enabled

Manohar_122_0-1723443212208.png

 

  • When generate token are you using refresh token or normal token ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

I am using normal access token

Then ouath can be kept as untick


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

What should i use if i need to keep the ouath as enabled and not disabled? because i want the ouath as enabled and also other api request like getuser and addrole api are working fine when the ouath is enabled and using the access token

Use refresh token api from postman package


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

No Its giving 401 error if i try to use the the refresh token with the oauth enabled

Use token from UI under web service auth


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Its not working even when using the token from UI under web service auth

Share curl

Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]



⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Curl command response

curl --location 'https://{URL}/ECM/api/v5/createrequest' \
--header 'SAVUSERNAME: admin' \
--header 'Content-Type: application/json' \
--header 'grant_type: refresh_token' \
--header 'refresh_token: yJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTUDA4VVFSUlwvZXh5QlNJSkFJZ2tGTm1KbjlrNUkwT1FhQWRGQTFqdkRlUTBtbXJuZHh6SXdPN1BNek1KZFE2NlNnZ0tEa3BqNEZlajlFTnI0QVlnV3R0UzJ2bG4rN0dsRG5HcjN6VzlcL1wvZldvVGUxemVcLzcrWkZlNkdGeVQ3ckJheldTY25OZU1IOFNxTlRQdnYwOHNQSitjSHJBVkoyaUdmXC92NCtaaGN2bXVrc3FTWmxtVnZYdGlHajN5dTZaeUJkdkpyXC9hUXRkdjhpUVZTSCtVdEJoZFN4VEVGTGVzbGJqcTI4S3R0VWF3XC9IYmg2WXVWZXY3NnNGcXR6aithZjF5ZEplblJQTGxibVI4b1d0amhyXC9mZmp1NzlJSnBWR054bElrTXFmcXdBMWJPa2pmcmQ2Y24weU1lZmgzbU1YSG4wUytNUHdrXC9cL2FCWURBQUE9Iiwic3ViIjoiMTAwMDY3NjgwMiIsImlhdCI6MTcyMzQ3MDY5NSwicm9sZXMiOlsiUk9MRV9BRE1JTiJdfQ.YRNiVd2lTWStvCd3lysQnocIxDUmwD2gn5PZcPYeJJI' \
--header 'Cookie: JSESSIONID=DB50441F075DED033F5E7A09FC1FC4AB; CCSRF-TOKEN=fef76784-09d5-4972-ad49-e4a3dd609c5a; INGRESSCOOKIE=1723442602.786.187.63802|0f4091fceac04271d9e9e5a60a3d3e8f; MS_REDIRECT_URL=https%3A%2F%2F{URL}%2FECM%2Foauth%2Ftoken; access_token=eyJhbGciOiJIUzI1NiJ9.eyJwcmluY2lwYWwiOiJINHNJQUFBQUFBQUFBSlZTdjA4VVFSajk5anlDOFJJRUUwMHNvQkU2c3hlNXlsd0RuS2ZCckFmaHVBWVR6ZHp1eHpvd083UE96TUpkUTY3Q2dnS2lrSkR3TFwvQ2ZRR05qWjdTd3BiYjFtK1hIbmpiRXFYNZGt0YXlXdTg3WndiMlVwYUw2ZmZcL0Ztc2VWZUs2dFVaSE94OFd6MmVZMjB4M0xycmpNXC9VTlRZM3ErRDhcLzBuUDRqbk5ZeHNNWkVoSlQ5ZWdGcFowa1c5ZTNvMFdUbjh1WmY3eUtYSHZ0WCtBRUhwdkNrWEF3QUEiLCJpc3MiOiJzc20tZGV2LXBtaS5zYXZpeW50Y2xvdWQuY29tIiwic3ViIjoiVGVzdEVJQzEyOTMiLCJleHAiOjE3MjM0NzIxMzcsImlhdCI6MTcyMzQ2ODUzNywicm9sZXMiOlsiUk9MRV9BRE1JTiJdfQ.V6akbLC58t_17anhRfp5knTXwPDmcsffqR249F-4Pgk; token_type=Bearer; user_name=TestEIC1293' \
--data '{
"accesstype":"ROLES",
"username":"TestEIC1293",
"roletype":"ENTERPRISE",
"requesttype":1,
"roles":[
{
"rolename" : "Test_Role_deleted",
"startdate" : "08-12-2024",
"enddate" : "10-06-2024",
"businessJustification" : "testjustification"
} ],
"requestcomments":"commemnt",
"requestor":"TestEIC1293"
}'

Validated in v24.4 and v24.7 with oauth 2 tick i am able to create request using API


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.