Created 10-24-2022 07:44 AM
I was trying to control apache nifi processors to start/stop by calling apache nifi-api. I am using Postman to make the call, for example to start a GenerateFlowFile processor:
https://localhost:8443/processors/{processor id} (PUT Request)
But I got the response status 403(forbidden) as shown in the image below.
I was able to make a get request.
I have also a client self-signed certificate generated using nifi-toolkit by following this https://kylo.readthedocs.io/en/v0.10.0/security/ConfigureNiFiWithSSL.html
from nifi.properties file:
Created 10-28-2022 05:20 AM
If you are able to get the token and communicate with the api from postman, thats a great start. The PUT request must have some other issue. Are you passing the token correctly?
Have you made sure that you are able to get the token, and make the put request from nifi node with command line? You always want to make sure you have working samples for any api system before you try to convert them to postman.
Created 10-24-2022 08:50 AM
@MaarufB Using nifi-cli outside of curl on a nifi node is definitely a challenge. There are a lot of things you need to check. Most of them are addressed in a similar post here:
https://community.cloudera.com/t5/Support-Questions/Calling-nifi-Api-using-Postman/td-p/343993
Hopefully you can find the solution within that post.
Created 10-24-2022 05:52 PM
Thanks, I'll be back here if I can solve my issue.
Created 10-25-2022 07:51 PM
@steven-matison Is it possible for single-user (default setup) to control the dataflow via API call from Postman?
Created 10-26-2022 05:41 AM
I believe so. Were you able to get a token using that user?
Created 10-26-2022 06:40 PM
Yes @steven-matison I was able to use a token in Postman. I put the access token in Authorization Tab > Bearer Token every time I make a request. However, when I used PUT request I just got 403(forbidden request).
Created 10-28-2022 05:20 AM
If you are able to get the token and communicate with the api from postman, thats a great start. The PUT request must have some other issue. Are you passing the token correctly?
Have you made sure that you are able to get the token, and make the put request from nifi node with command line? You always want to make sure you have working samples for any api system before you try to convert them to postman.
Created 11-15-2022 11:50 PM
Sorry my bad, I forgot to reply here. Anyways I was able to fix the issue by clearing the cookies in the Postman and Put my Bearer token to the Authorization Header. Thanks for the help by the way.