shared flow attachment in Flow hook using management API

How to attach the shared flow in flow hook using management API. I am using the correct shared flow which is deployed to test environment.

I am using below management API call.

put - https://api.enterprise.apigee.com/v1/organizations/{org_name}/environments/{env_name}/flowhooks/{flo...

{
"FlowHook": {
"SharedFlow": "abcd"
}
}

I tried using management API and I am getting an error.

{
"code": "messaging.config.beans.InvalidSharedFlow",
"message": "Shared Flow named null is not existing, or not deployed in organization abcd environment test",
"contexts": []
}

Solved Solved
1 1 150
1 ACCEPTED SOLUTION

Yes.  I'm sorry that the API documentation for flowhooks does not give an example of the payload for the PUT call.  The problem is your term "SharedFlow" must be "sharedFlow", with the first letter in lowercase.  Like this:

PUT :mgmtserver/v1/o/:org/e/:env/flowhooks/PreProxyFlowHook
Authorization: Bearer :token
content-type: application/json

{
 "sharedFlow": "foobar"
}

 

View solution in original post

1 REPLY 1

Yes.  I'm sorry that the API documentation for flowhooks does not give an example of the payload for the PUT call.  The problem is your term "SharedFlow" must be "sharedFlow", with the first letter in lowercase.  Like this:

PUT :mgmtserver/v1/o/:org/e/:env/flowhooks/PreProxyFlowHook
Authorization: Bearer :token
content-type: application/json

{
 "sharedFlow": "foobar"
}