Use the B2B Gateway Run Partner API to run inbound and outbound partner flows.
You can use the Run Partner API only for flows with the scheduling option Manually or by an external trigger.
When you run an outbound flow with the Run Partner REST API, if the process-from-backend mapping contains parameters, you can pass the parameter values in the API request. When you run the partner with the API, the values that you define in the API override those that you define in the partner flow.
For example, one of the mapping parameters is the shipment number, and you define the value in the outbound partner flow. If you need to send a one-time message with a different shipment number, run the flow with the API and assign the shipment number parameter a different value.
If you later reprocess the file event, B2B Gateway doesn't run the flow with the API. Therefore, it passes the parameter values that you define in the partner flow, not those that you define in the API.
The Run Partner API returns the response code of the action that you perform. If the partner flow triggers successfully, the API returns the event ID of the task event that B2B Gateway generates. You can run the B2B Gateway Event Status API to query the status of the event based on the event ID.
When you run partner flows, you can also include the mapping task advanced session parameters in the Run Partner API using the mctAdvSessionProperties object. Any mismatch between the API parameters and the session parameters will appear as a runtime error in the Events page.
Run Partner REST API request
Use a POST request with an application/json content type to run a partner flow.
Tip: You can copy the values of <pod> and <baseUrl> from the B2B Gateway URL after you access it from the My Services page of Informatica Intelligent Cloud Services.
Request syntax
To run a flow, use the following request syntax:
{ "partnerName":"<partner name>", "direction":"<direction of flow>" }
Where:
•partner name is the name of the partner to run the flow for. The name must not contain angled brackets (<>), backslashes (\), or double quotes ("). If the defined partner name contains backslashes, add another backslash before each existing backslash (\\). If the defined partner name contains double quotes, add a backslash before each double quote (\").
•direction of flow is the flow to run for the customer: INBOUND for an inbound flow and OUTBOUND for an outbound flow. The direction is not case sensitive.
For example:
To run the inbound flow for the customer My_Customer, use the following request syntax:
When you run partner flows, you can also include the mapping task advanced session parameters in the Run Partner API using the mctAdvSessionProperties object.
Use the following request syntax that includes the buffer block size as advance session mapping parameter session when you run an inbound flow:
You can pass the values of process-from-backend mapping parameters in the Run Partner REST API request.
To pass parameter values in the request, add a "mappingParameters" section to the request body. The section can include one or both of the following categories:
•"inputParameters". Contains one or more key-value pairs of input parameters.
•"inOutParameters". Contains one or more key-value pairs of in-out parameters.
Use the following syntax for the key-value pairs:
"<mapping parameter name>": "<parameter value>"
For example:
To run the outbound flow for the customer My_Customer and pass the values of the invoice number and the shipment number in the request, use the following syntax:
When you use the B2B Gateway Run Partner REST API to run a partner flow, B2B Gateway returns the action response in the REST API response.
Running a flow from the REST API returns the HTTP response code that is relevant to the result of the action
•When the request succeeds, B2B Gateway returns 200, the code for a successful request.
•When the request fails, the API returns the HTTP response code that is relevant to the cause of the error. For example, if the value of direction is wrong, the API returns 400, the code for a bad request.