Skip to main content
MeAndB
Gold ⭐️
January 9, 2022
Solved

NiFi rest api creating parameter context

Hi,

 

I noticed that in NiFi rest api documentation for version 1.9.0 the parameter context endpoints have been removed, even though they existed in version 1.15.2

MeAndB_0-1641707745629.png

Furthermore, I am using NiFi version 1.13.2 and I can see that in my browser's debugging tools, in the network tab, whenever I create a parameter context, a post request is sent to 

and the following payload is being sent :

{
"component": {
"name": "aaaaaaaaaaa",
"description": "aaaaaaaaaaaaaaaa",
"parameters": []
},
"revision": {
"clientId": "3d3697c2-017e-1000-0610-31b28073cf9b",
"version": 0
}
}

 

The parameter context is successfully created. However when I attempt to send a post request from an external API or even hit the previously mentioned endpoint through the browser using the same payload, I get:

HTTP 405 Method Not Allowed

 My questions are:

1. Is anyone aware whether these endpoints have been removed/restricted intentionally?

2. If they are not remove/restricted, has anyone been able to successfully send a post request and create a parameter context through NiFi's rest api?

MeAndB
MeAndBAnswer
Gold ⭐️
January 9, 2022

Hi,

 

I figured it out. It had to do with me not serialising the data to json properly before passing it as json and also I should have used the following for the header:

 

 

headers={"Content-type": "application/json", "Accept": "application/json"}

 

 

Also, this means, that even though the parameter context endpoints are not listed in version 1.9.0., they are still available.

1 reply

MeAndB
MeAndBAuthorAnswer
Gold ⭐️
January 9, 2022

Hi,

 

I figured it out. It had to do with me not serialising the data to json properly before passing it as json and also I should have used the following for the header:

 

 

headers={"Content-type": "application/json", "Accept": "application/json"}

 

 

Also, this means, that even though the parameter context endpoints are not listed in version 1.9.0., they are still available.

Translate