Is there a way to unify all success / failure responses structure across multiple application integrations for better consistancy?
something like applying a shared flow in Apigee.
is there a best practice or a guideline of how to do this ?
Solved! Go to Solution.
Hi @dareenhamdy,
Yes, you can unify success and failure response structures across multiple integrations using Apigee API Gateway. Apigee allows you to create Shared Flows, which lets you define common logic (like response formatting) that can be applied consistently across your APIs. This is similar to what you’re thinking of with shared flows, and it’s a great way to ensure all responses (success or error) follow the same structure.
Use Apigee Shared Flows: Define the response format (e.g., success or error) in a shared flow, and then apply it to multiple API proxies. This ensures consistent response structures across all your APIs.
Best Practices:
Cloud Functions/Run for Backend: If your services are backend-driven (like Cloud Functions or Cloud Run), implement a middleware or standard response wrapper to ensure consistency before responses are sent out.
For more details, you can check out the Apigee Developing Shared Flows documentation.
Hope this helps!
Hi dareenhamdy,
If you're using a standalone App Integration, another approach is to have an integration just for the success/failure response content. Then all other integrations (which you want a unified behavior) to call this integration for consistent response content.
Thanks!
Hey @dareenhamdy, thanks for your question - We’re keeping an eye on this thread. Your patience means a lot to us, in the meantime consider checking our articles and upcoming events!
Hi @dareenhamdy,
Yes, you can unify success and failure response structures across multiple integrations using Apigee API Gateway. Apigee allows you to create Shared Flows, which lets you define common logic (like response formatting) that can be applied consistently across your APIs. This is similar to what you’re thinking of with shared flows, and it’s a great way to ensure all responses (success or error) follow the same structure.
Use Apigee Shared Flows: Define the response format (e.g., success or error) in a shared flow, and then apply it to multiple API proxies. This ensures consistent response structures across all your APIs.
Best Practices:
Cloud Functions/Run for Backend: If your services are backend-driven (like Cloud Functions or Cloud Run), implement a middleware or standard response wrapper to ensure consistency before responses are sent out.
For more details, you can check out the Apigee Developing Shared Flows documentation.
Hope this helps!
Thank you for replying. It's so detailed.
I just did not get how to implement a middleware or standard response wrapper to ensure consistency before responses are sent out if the services are backend driven part. ??
but there are 2 major points
1st point is when it come to shared flows I have one of 2 options to apply a shared flow, weather using a flow callout and I still have to call this in every single proxy that I need which is a bit repetitive, or to put that in a flow hook to automatically apply on all proxies defined in this environment which may not be the case I want. so Is there a way to apply on a selected group of proxies ?
2nd point is what If I have some application integration that are not triggered through an Apigee proxy (stand alone Integrations) if we can call it so , like a scheduled task or a pub/sub trigger. How can we achieve this concept of unifying responses across those Integrations ??
those are my uses cases please advise
Hi dareenhamdy,
If you're using a standalone App Integration, another approach is to have an integration just for the success/failure response content. Then all other integrations (which you want a unified behavior) to call this integration for consistent response content.
Thanks!