Example Outbound API

Create an outbound API that sends data from guided buying to your client application. It must pass fields supplied by guided buying.

The outbound API must pass the following fields:

Field name Type Description Example

realm

string

The name of the SAP Ariba realm that hosts the guided buying instance where the form was submitted.

ACMECorporate

documentId

string

The guided buying unique identifier for form instances of type "Externally Managed."

EM546

documentProcessName

string

The name of your organization's process under which the form was created.

SupplierApprovalProcess

title

string

The name that the user assigned to the form instance.

Approval request for BigSupplier Inc.

erpVendorId

string

The unique identifier for the supplier, which is assigned by your ERP system.

sid2076

supplierName

string

The name of the supplier that was selected by the user.

BigSupplier Inc.

formtemplateId

string

The guided buying identifier for the form template, which is assigned during template design.

8a76a11d-97cd-40e2-4125-2641cb7eb74a

formDocumentId

integer

The unique guided buying identifier for the form instance, which is assigned when the user submits a form.

30298

formCreatedDate

date/time

The date and time (ISO 8601) when the user created the form instance.

2020-07-04T12:08:56.235+05:30

formSubmittedDate

date/time

The date and time (ISO 8601) when the form was submitted.

2020-07-04T12:18:56.235+05:30

formApprovalDate

date/time

The date and time (ISO 8601) when the form was approved.

2020-07-04T12:28:56.235+05:30

formLastUpdatedDate

date/time

The date and time (ISO 8601) when the form was last changed.

2020-07-04T12:38:56.235+05:30

The following example swagger listing shows how you might create the outbound API.
{
  "swagger": "2.0",
  "info": {
    "description": "API for sending externally managed form data to an
     external service",
    "version": "1.0",
    "title": "Externally Managed Form Outbound API"
  },
  "tags": [
    {
      "name": "Externally Managed Form Outbound API",
      "description": "Externally Managed Form Outbound API"
    }
  ],
  "schemes": [
    "https"
  ],
  "paths": {
    "/externalDocuments": {
      "post": {
        "tags": [
          "Externally Managed Form Outbound API"
        ],
        "summary": "Submit externally managed form data",
        "operationId": "externalDocumentsPost",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ExternallyManagedDocumentOutboundRequest"
            },
            "description": "Externally managed form input details"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully sent externally managed form",
            "schema": {
              "$ref": "#/definitions/ExternallyManagedDocumentOutboundResponse"
            }
          },
          "400": {
            "description": "Invalid externally managed form request",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          },
          "403": {
            "description": "Forbidden",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "ExternallyManagedDocumentOutboundRequest": {
      "description": "Input for sending externally managed form data to
       external service",
      "type": "object",
      "required": [
        "realm",
        "documentId",
        "documentProcessName",
        "title",
        "erpVendorId",
        "supplierName",
        "formTemplateId",
        "formDocumentId",
        "formCreatedDate"
      ],
      "properties": {
        "realm": {
          "type": "string",
          "minLength": 2,
          "maxLength": 192,
          "description": "Realm where the externally managed form was created"
        },
        "documentId": {
          "type": "string",
          "description": "Externally managed form ID"
        },
        "documentProcessName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Process name defined for the externally managed form"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50,
          "description": "Externally managed form title"
        },
        "erpVendorId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50,
          "description": "erpVendorId (uniqueName)"
        },
        "supplierName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Supplier Name"
        },
        "smVendorId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "smVendorId"
        },
        "anId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Ariba Network ID"
        },
        "otherSupplierIds": {
          "type": "array",
          "description": "A list of domain/value pairs for other IDs for
           the supplier",
          "items": {
            "$ref": "#/definitions/OrganizationID"
          }
        },
        "isPreferredSupplier": {
          "type": "boolean",
          "example": false,
          "description": "Is preferred supplier"
        },
        "justification": {
          "type": "string",
          "minLength": 2,
          "maxLength": 1024,
          "description": "Justification text entered by the user when
           submitting the form"
        },
        "formTemplateId": {
          "type": "string",
          "minLength": 2,
          "maxLength": 256,
          "description": "Form template ID"
        },
        "formDocumentId": {
          "type": "integer",
          "description": "Internal form document ID"
        },
        "formCreatedDate": {
          "type": "string",
          "description": "The time the form was created (in ISO8601, GMT)",
          "format": "date-time",
          "example": "2019-07-04T12:08:56.235+05:30"
        },
        "formApprovedDate": {
          "type": "string",
          "description": "If the form was approved, the time the form was
           approved (in ISO8601, GMT)",
          "format": "date-time"
        },
        "formSubmittedDate": {
          "type": "string",
          "description": "The time the form was submitted (in ISO8601, GMT)",
          "format": "date-time"
        },
        "formLastUpdatedDate": {
          "type": "string",
          "description": "The time the form was last updated (in ISO8601, GMT)",
          "format": "date-time"
        }
      }
    },
    "OrganizationID": {
      "type": "object",
      "required": [
        "domain"
      ],
      "properties": {
        "domain": {
          "type": "string",
          "description": "domain name"
        },
        "value": {
          "type": "string",
          "description": "domain value"
        }
      },
      "description": "The domain/pair for a supplier, possible domain
       names: ANORG, internalsupplierid, S4, transactionnetworkid, SSP,
       sourcingnetworkid etc."
    },
    "ExternallyManagedDocumentOutboundResponse": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Status returned by the external system for its
           internal purpose"
        },
        "messageId": {
          "type": "string",
          "description": "Message ID returned by the external system for
           its internal purpose"
        }
      }
    },
    "ErrorResponse": {
      "type": "object",
      "required": [
        "status",
        "error"
      ],
      "properties": {
        "status": {
          "type": "integer",
          "format": "int32",
          "description": "HTTP status code"
        },
        "error": {
          "type": "string",
          "description": "Error message"
        },
        "description": {
          "type": "string",
          "description": "Error description"
        }
      },
      "description": "The error response"
    }
  }
}