You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Devin Pinkston <pi...@gmail.com> on 2015/10/13 03:22:27 UTC

Put to update a processor (REST API)

I'm trying to do a put to update a GetTwitter Processor, I want to set the
Consumer & Access Token Secret.  Doing the follow put with application/json
always gives me a 400 error.  This is the put body:

{
    "revision": {
    "version": 0,
    "lastModifier": "value"
    },
    "processor": {
        "config": {
            "Consumer Secret": "xxx",
            "Access Token Secret": "xxx"
            }
    }
}

I am using this URI:
http://localhost:8080/nifi-api/controller/process-groups/9084b91c-8e28-4635-a7c6-991afe36b4ca/processors/fc3d62c0-995a-4075-bfa6-396fd89358d2

I know the URI is right, but for some reason the body keeps throwing
errors.  Am i missing something?  Everything else looks to be optional.

This the error everytime:

400 Bad Request: Message body is malformed. Unable to map into expected
format.

Thank you

Re: Put to update a processor (REST API)

Posted by Devin Pinkston <pi...@gmail.com>.
Joe-

Will do, working with a few front-ends (Aurelia/ReactJS) & node
microservices.  We are just starting so I will post everything we find out
here!


On Tue, Oct 13, 2015 at 10:02 AM, Joe Witt <jo...@gmail.com> wrote:

> Devin - it is awesome that you're doing programmatic calls against the
> API.  Let us know as you go and please fire early and often on
> questions/ideas.
>
> Thanks
> Joe
>
> On Tue, Oct 13, 2015 at 10:01 AM, Devin Pinkston <pi...@gmail.com>
> wrote:
> > Matt thank you very much that did the trick!
> >
> > On Mon, Oct 12, 2015 at 10:33 PM, Matt Gilman <ma...@gmail.com>
> > wrote:
> >>
> >> Devin,
> >>
> >> Within the config you need specify "properties".
> >>
> >> {
> >>     "revision": {
> >>         "version": 0,
> >>         "lastModifier": "value"
> >>     },
> >>     "processor": {
> >>         "config": {
> >>             "properties": {
> >>                 "Consumer Secret": "xxx",
> >>                 "Access Token Secret": "xxx"
> >>             }
> >>          }
> >>     }
> >> }
> >>
> >> Let me know if that helps! Thanks.
> >>
> >> Matt
> >>
> >> On Mon, Oct 12, 2015 at 9:22 PM, Devin Pinkston <pinkdevelops@gmail.com
> >
> >> wrote:
> >>>
> >>> I'm trying to do a put to update a GetTwitter Processor, I want to set
> >>> the Consumer & Access Token Secret.  Doing the follow put with
> >>> application/json always gives me a 400 error.  This is the put body:
> >>>
> >>> {
> >>>     "revision": {
> >>>     "version": 0,
> >>>     "lastModifier": "value"
> >>>     },
> >>>     "processor": {
> >>>         "config": {
> >>>             "Consumer Secret": "xxx",
> >>>             "Access Token Secret": "xxx"
> >>>             }
> >>>     }
> >>> }
> >>>
> >>> I am using this URI:
> >>>
> >>>
> http://localhost:8080/nifi-api/controller/process-groups/9084b91c-8e28-4635-a7c6-991afe36b4ca/processors/fc3d62c0-995a-4075-bfa6-396fd89358d2
> >>>
> >>> I know the URI is right, but for some reason the body keeps throwing
> >>> errors.  Am i missing something?  Everything else looks to be optional.
> >>>
> >>> This the error everytime:
> >>>
> >>> 400 Bad Request: Message body is malformed. Unable to map into expected
> >>> format.
> >>>
> >>> Thank you
> >>
> >>
> >
>

Re: Put to update a processor (REST API)

Posted by Joe Witt <jo...@gmail.com>.
Devin - it is awesome that you're doing programmatic calls against the
API.  Let us know as you go and please fire early and often on
questions/ideas.

Thanks
Joe

On Tue, Oct 13, 2015 at 10:01 AM, Devin Pinkston <pi...@gmail.com> wrote:
> Matt thank you very much that did the trick!
>
> On Mon, Oct 12, 2015 at 10:33 PM, Matt Gilman <ma...@gmail.com>
> wrote:
>>
>> Devin,
>>
>> Within the config you need specify "properties".
>>
>> {
>>     "revision": {
>>         "version": 0,
>>         "lastModifier": "value"
>>     },
>>     "processor": {
>>         "config": {
>>             "properties": {
>>                 "Consumer Secret": "xxx",
>>                 "Access Token Secret": "xxx"
>>             }
>>          }
>>     }
>> }
>>
>> Let me know if that helps! Thanks.
>>
>> Matt
>>
>> On Mon, Oct 12, 2015 at 9:22 PM, Devin Pinkston <pi...@gmail.com>
>> wrote:
>>>
>>> I'm trying to do a put to update a GetTwitter Processor, I want to set
>>> the Consumer & Access Token Secret.  Doing the follow put with
>>> application/json always gives me a 400 error.  This is the put body:
>>>
>>> {
>>>     "revision": {
>>>     "version": 0,
>>>     "lastModifier": "value"
>>>     },
>>>     "processor": {
>>>         "config": {
>>>             "Consumer Secret": "xxx",
>>>             "Access Token Secret": "xxx"
>>>             }
>>>     }
>>> }
>>>
>>> I am using this URI:
>>>
>>> http://localhost:8080/nifi-api/controller/process-groups/9084b91c-8e28-4635-a7c6-991afe36b4ca/processors/fc3d62c0-995a-4075-bfa6-396fd89358d2
>>>
>>> I know the URI is right, but for some reason the body keeps throwing
>>> errors.  Am i missing something?  Everything else looks to be optional.
>>>
>>> This the error everytime:
>>>
>>> 400 Bad Request: Message body is malformed. Unable to map into expected
>>> format.
>>>
>>> Thank you
>>
>>
>

Re: Put to update a processor (REST API)

Posted by Devin Pinkston <pi...@gmail.com>.
Matt thank you very much that did the trick!

On Mon, Oct 12, 2015 at 10:33 PM, Matt Gilman <ma...@gmail.com>
wrote:

> Devin,
>
> Within the config you need specify "properties".
>
> {
>     "revision": {
>         "version": 0,
>         "lastModifier": "value"
>     },
>     "processor": {
>         "config": {
>             "properties": {
>                 "Consumer Secret": "xxx",
>                 "Access Token Secret": "xxx"
>             }
>          }
>     }
> }
>
> Let me know if that helps! Thanks.
>
> Matt
>
> On Mon, Oct 12, 2015 at 9:22 PM, Devin Pinkston <pi...@gmail.com>
> wrote:
>
>> I'm trying to do a put to update a GetTwitter Processor, I want to set
>> the Consumer & Access Token Secret.  Doing the follow put with
>> application/json always gives me a 400 error.  This is the put body:
>>
>> {
>>     "revision": {
>>     "version": 0,
>>     "lastModifier": "value"
>>     },
>>     "processor": {
>>         "config": {
>>             "Consumer Secret": "xxx",
>>             "Access Token Secret": "xxx"
>>             }
>>     }
>> }
>>
>> I am using this URI:
>>
>> http://localhost:8080/nifi-api/controller/process-groups/9084b91c-8e28-4635-a7c6-991afe36b4ca/processors/fc3d62c0-995a-4075-bfa6-396fd89358d2
>>
>> I know the URI is right, but for some reason the body keeps throwing
>> errors.  Am i missing something?  Everything else looks to be optional.
>>
>> This the error everytime:
>>
>> 400 Bad Request: Message body is malformed. Unable to map into expected
>> format.
>>
>> Thank you
>>
>
>

Re: Put to update a processor (REST API)

Posted by Matt Gilman <ma...@gmail.com>.
Devin,

Within the config you need specify "properties".

{
    "revision": {
        "version": 0,
        "lastModifier": "value"
    },
    "processor": {
        "config": {
            "properties": {
                "Consumer Secret": "xxx",
                "Access Token Secret": "xxx"
            }
         }
    }
}

Let me know if that helps! Thanks.

Matt

On Mon, Oct 12, 2015 at 9:22 PM, Devin Pinkston <pi...@gmail.com>
wrote:

> I'm trying to do a put to update a GetTwitter Processor, I want to set the
> Consumer & Access Token Secret.  Doing the follow put with application/json
> always gives me a 400 error.  This is the put body:
>
> {
>     "revision": {
>     "version": 0,
>     "lastModifier": "value"
>     },
>     "processor": {
>         "config": {
>             "Consumer Secret": "xxx",
>             "Access Token Secret": "xxx"
>             }
>     }
> }
>
> I am using this URI:
>
> http://localhost:8080/nifi-api/controller/process-groups/9084b91c-8e28-4635-a7c6-991afe36b4ca/processors/fc3d62c0-995a-4075-bfa6-396fd89358d2
>
> I know the URI is right, but for some reason the body keeps throwing
> errors.  Am i missing something?  Everything else looks to be optional.
>
> This the error everytime:
>
> 400 Bad Request: Message body is malformed. Unable to map into expected
> format.
>
> Thank you
>