Support Questions

Find answers, ask questions, and share your expertise

Not able to update ParameterContent using Nifi REST API

avatar
Contributor

Hello All,

I am using Nifi 2.0

I want to update existing Parameter Context using Nifi API.  For that , following API is used 

https://localhost:8443/nifi-api/parameter-contexts/2ddc0cea-018e-1000-3852-3611d730f705/update-reque...

Where  "2ddc0cea-018e-1000-3852-3611d730f705" is the Id of parameter context. 

mohdriyaz_0-1710217058741.png

Issue : 

I tried to update the ParameterContext using 

https://localhost:8443/nifi-api/parameter-contexts/2ddc0cea-018e-1000-3852-3611d730f705/update-reque...

but its throwing 403 error .

I updated the Request with  token (Bearer) but still getting the same error. 

Any Pointers..??

Thanks, 

Riyaz

 

 

 

1 ACCEPTED SOLUTION

avatar
Contributor

I am able to solve the problem 

Access token Rest API generates two token (check under cookies)  - Secure-Request-Token and other is Secure-Authorization-Bearer token. 

While calling any of the other API (like creating Parameter Context or updating Parameter context)  - in Headers provide one more header "Request-Token"  with the value of  _secure-Request-Token (From cookies).

View solution in original post

5 REPLIES 5

avatar
Community Manager

@mohdriyaz, Welcome to our community! To help you get the best possible answer, I have tagged in our NiFi experts @cotopaul @SAMSAL @TimothySpann  who may be able to assist you further.

Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.



Regards,

Vidya Sargur,
Community Manager


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Master Collaborator

403 : Client is not authorized to make this request. 

This means you are Authenticated and since you have a valid token but you are not authorized to do this action.

to double-check if your user is Authorized, check if you can do the same action directly from NiFi UI ?  

Thank you 

avatar
Contributor

@ckumar 

Yes , i am able to do the changes via Nifi UI.

Note : 

I have created the user user using following command  :  

nifi.cmd set-single-user-credentials username password

 

avatar
Master Collaborator

I would further interested check nifi-user.log to see the forbidden events when you see  403 error 

avatar
Contributor

I am able to solve the problem 

Access token Rest API generates two token (check under cookies)  - Secure-Request-Token and other is Secure-Authorization-Bearer token. 

While calling any of the other API (like creating Parameter Context or updating Parameter context)  - in Headers provide one more header "Request-Token"  with the value of  _secure-Request-Token (From cookies).