Hello Team,
I’m new to the APIGEE and exploring. I have a query on below requirement
I want to send the response as “Message sent successfully” if the message is sent to target endpoint successfully
I found a way we can do that using policy in below format
{
"Response": " Message sent successfully"
}
Instead of this method, is it possible to write this response directly in the postflow response in any way?
Please help
Thanks,
Dinesh
You can use an AssignMessage policy to set the response to whatever value you choose. You would use Set/Payload for that.
You must ATTACH that policy to the response flow, somewhere, in order for it to be executed by Apigee.
- ONE PLACE you can attach it is in the Response PostFlow.
- ANOTHER PLACE you can attach it is in the Response PreFlow.
- You can also use the Response Conditional Flow.
For more on these possible attachment points, consult the documentation.
As an alternative to AssignMessage, you could also use a JavaScript policy to write something into response.content.
If you choose to use the JavaScript policy, you would again need to attach it, in the same way as with AssignMessage.