B2B Gateway > B2B Gateway REST APIs > Run Partner REST API
  

Run Partner REST API

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.
To run a flow, use the following REST URL:
https://use6-b2bgw.dm-us.informaticacloud.com/b2b-gw/api/v1/partner/run
Where:
For example:
https://use6-b2bgw.dm-us.informaticacloud.com/b2b-gw/api/v1/partner/run
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:
For example:
To run the inbound flow for the customer My_Customer, use the following request syntax:
{
"partnerName":"My_Customer",
"direction":"INBOUND"
}
To run the outbound flow for the customer My_Customer, use the following request syntax:
{
"partnerName":"My_Customer",
"direction":"OUTBOUND"
}
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:
{
"partnerName":
"<Customer name>",
"direction":"INBOUND",
"mappingParameters": {
"inputParameters": {"param": "no"},
{
"inOutParameters": {
"ob_customer_param": "<parameter value>"
},
{"mctAdvSessionProperties":
{"Default buffer block size": "<Buffer block size in megabytes>"
}
}
}
Use the following request syntax that includes the buffer block size as advance session mapping parameter session when you run an outbound flow:

{
"direction": "outbound",
"partnerName": "ob_with_parameters",
"mappingParameters":
{
"inputParameters":
{
"param": "no"
},
"inOutParameters":
{"ob_customer_param": "60"
},
"mctAdvSessionProperties": { "Default buffer block size": "18MB"
}
}
}
The following table shows the sample Run Partner REST API request and the corresponding response:
Request
Response
{
"partnerName":"sony_out_ER-32909",
"direction":"INBOUND",
"mappingParameters": {
"mctAdvSessionProperties": {
"Default buffer block size": "18MB"
}
}
}
{ "responseStatus": "SUCCESS",
"responseExtraMessage": "",
"responseType": "/v1/partner/run",
"eventId": 15648046
}

Pass parameter values in outbound flows

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:
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:
{
"partnerName":"My_Customer",
"direction":"OUTBOUND",
"mappingParameters": {
"inputParameters": {
"Invoice_Number": "7800"
},
"inOutParameters": {
"Shipment_Number": "A3065"
}
}
}

Run Partner REST API action response

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