---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Presentation Components, widgets, tags, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: outboundDataURI
layout: subsection
wd_wcptag: outboundDataURI
---

<a id="section_N10021_N1001E_N10001"></a>
Represents an outbound endpoint in the `outboundEndPoints` array. `outboundDataURI` is the default tag type in `outboundEndPoints[]`. Use `outboundDataURI` only on edit pages.

For each outbound endpoint in `outboundEndPoints[]`, specify these required fields:

-   `url` - The relative REST API URL. The default HTTP method of an outbound endpoint is POST. To override the default, specify the `httpMethod` attribute.
-   `baseUrlType` - Specify a `dataProvider` key defined in the AMD.
-   `name` - Enables you to reference the outbound endpoint when you bind a field to a tag value.
-   `authType` - Specify the authType `id`, which is defined in `authTypes[]` in the Site Metadata (SMD). Workday REST APIs use `SSO`, which is the default authentication type.

    <b>Note:</b> Except for the `ISU` authentication scheme, you can specify the `scheme` value in the SMD as the `authType` value in PMDs. For the `ISU` authentication scheme, use the `id` value that's defined in the SMD.



This sample `outboundEndPoints[]` contains an `outboundDataURI` tag, which is the default tag. This example calls the `POST /requisitions` outbound endpoint.

```
"outboundData": {
  "outboundEndPoints": [
      {
        "name": "submitRequisition",
        "url": "/requisitions",
        "authType": "sso",
        "baseUrlType": "workday-procurement"
      }
  ]
}
```

This example defines the <i>workday-procurement</i> data provider in the AMD:

```
{
  "key": "workday-procurement",
  "value": "https://api.workday.com/procurement/v3/"
}
```

## <a id="section_fk3_hh5_x5b"></a>Usage

See [Concept: Submitting Data](/wcp_docs/rmd1572291186381.html).

## <a id="section_mobileSupport"></a>Mobile Support

Android, iOS

## <a id="section_attributes"></a>Attributes

-   <b>allowEmptyPayload</b>

    Data type: binding-Boolean

    If true, the request payload of the outbound endpoint can be empty (`null` or `""`). If the request payload is empty, we send the request payload as `{}`.

    If false, we don't submit the outbound endpoint if the request payload is empty (`null` or `""`). The default is false.

-   <b>allowEmptyValue</b>

    Data type: binding-Boolean

    If true, we send all fields in the request payload even if a field is empty (`""`, `0`, or `[]`).

    If false, we don't include empty fields in the request payload. The default is false.

-   <b>allowPutForUnchangedData</b>

    Data type: binding-Boolean

    If true, we submit outbound PUT endpoints even when the data didn't change. If false, we don't submit the PUT request when the data didn't change. The default is false.

-   <b>authType</b>

    Data type: binding-String

    The id of the authentication scheme for authenticating the endpoint. The SMD of your app defines the authentication scheme id in the `authTypes` array. You can use different authentication types on different endpoints on the same page.

    The default is Workday Single-Sign On (SSO).

    <b>Note:</b>

    Except for the `ISU` authentication scheme, you can specify the `scheme` value in the SMD as the `authType` in PMDs. For the `ISU` authentication scheme, use the `id` value that's defined in the SMD.

-   <b>baseUrlType</b>

    Data type: string

    Specifies the base URL of the endpoint to invoke. We append the `url` attribute to `baseUrlType` to get the full API endpoint.

    Specify the `key` of a data provider declared in the `dataProviders` section of the AMD.

-   <b>bestEffort</b>

    Data type: boolean

    If true, the page doesn't throw an error when a widget encounters an error. Instead, the page continues to render the page without the widget or with the "error" value on the widget. The default is false.

-   <b>exclude</b>

    Data type: dynamicBinding-Boolean

    If true, the page doesn't call the endpoint. You can specify an expression that determines whether or not to exclude the endpoint from invocation. The default is false.

    This example excludes calling the endpoint if `selectedWorker` is empty:

    ```
    "url": "<% '/workers/' + selectedWorker + '/serviceDates' %>",
    "exclude": "<% empty selectedWorker %>"
    ```

-   <b>failOnStatusCodes</b>

    Data type: list of HttpStatusCode objects

    An array containing HTTP status codes that Presentation Components must treat as errors. When an endpoint returns a status code listed in `failOnStatusCodes`, Presentation Components returns a page error or routes the error to a configured custom error page.

    An array item consists of these attributes:

    -   `code` - (Required) The HTTP error code to ignore.
    -   `codeName` - (Informational only) Describes the status code. Use this field for your information only; it has no effect.

    Example:

    ```
    "failOnStatusCodes": [
          {"code": 403}
    ]
    ```

    By default, Presentation Components treat these HTTP status codes as errors:

    -   301 - Moved permanently.
    -   302 - Found.
    -   303 - See other.
    -   307 - Temporary redirect.
    -   401 - Unauthorized.
    -   404 - Not found.
    -   407 - Proxy authentication required.
    -   408 - Request timeout.
    -   500 - Internal server error.
    -   503 - Service unavailable.

    For the standard descriptions of the status codes, see [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).

    Presentation Components ignore all other HTTP status codes not included in the above list. If your app requires that any of the ignored status codes must fail, specify the status code in the `failOnStatusCodes` attribute. If you configured custom error pages in your app, Presentation Components route the errors to the custom error pages. See [Reference: Custom Error Pages](/wcp_docs/vfx1525988737823.html).

    To ignore any of the HTTP status codes in the above list, specify the status code in the `ignoreFailures` attribute.

-   <a id="dlentry_graphQuery"></a><b>graphQuery</b>

    Data type: Map

    Specifies a query or mutation for the Graph API endpoint. You must set the `httpMethod` attribute to `POST`.

    Specify either `query` for an inline query or mutation, or `queryId` to reference a reusable Graph Query component. The `query` and `queryId` properties are mutually exclusive.

    `graphQuery` properties:

    -   <a id="dlentry_graphQuery_query"></a><b>query</b>

        A static string containing an inline query or mutation.

        The `query` string can contain variable placeholders (with the `$` prefix character), but it can't contain dynamic values. Specify the variable values in `variables`.

        To embed a literal string inside the `query` string, use escaped double quotes.

    -   <a id="dlentry_graphQuery_queryId"></a><b>queryId</b>

        A static string containing the ID of the Graph Query component you want to reference. The `queryId` must match the `id` of the Graph Query component.

    -   <a id="dlentry_graphQuery_parameters"></a><b>parameters</b>

        A script that returns a map, or a map containing parameters sent to the Graph Query component, where:

        -   <i>key</i>

            A static string containing the parameter name, which should match the name in `parameters[]` inside the Graph Query component.

        -   <i>value</i>

            An object containing the parameter value, which can be a script or any value including a boolean, string, number, native JSON map or native JSON array.


        Use `parameters` to send dynamic data to a Graph Query. Note that Graph Query components are self-contained modules and don't have page context. Use the parameters to send any app or page-specific variables.

    -   <a id="dlentry_graphQuery_variables"></a><b>variables</b>

        A map containing dynamic values for the query or mutation, where:

        -   <i>key</i>

            A static string containing the variable name, which should match the <i>$placeholderVariable</i> inside the `query` string.

        -   <i>value</i>

            An object containing the variable value, which can be a script or any value including a boolean, string, number, native JSON map or native JSON array.



    If you intend to use a Graph Query component but it's easier to define dynamic query variables in the PMD endpoint, you can specify both `queryId` and `variables` in `graphQuery`. If you use `variables` with `queryId`:

    -   If the Graph Query component also contains `variables`, the `variables` in the PMD overrides the Graph Query component variables.
    -   The `variables` and `parameters` properties of `graphQuery` are mutually exclusive.

    <b>Note:</b> The Graph API endpoint can return the 200 status code with partial response and errors. Note that if the Graph API endpoint response contains `errors[]`, the page treats it as an error, even if the endpoint response status code is 200.

    For more information about Graph API, see [Workday Graph API](/wcp_docs/vyw1671061988370.html).

-   <b>headers</b>

    Data type: list of endPointHeader objects

    An array containing HTTP headers. Use the `headers` attribute if your REST API endpoint requires any HTTP header. Each item in the `headers` array contains the `name` and `value` of the HTTP header. You can only specify static values.

    Example:

    ```
    "headers": [
    {
      "name": "Accept",
      "value": "application/json"
    }
    ]
    ```

-   <b>httpMethod</b>

    Data type: string

    The HTTP method for the outbound endpoint. Valid values:

    -   GET
    -   PATCH
    -   POST
    -   PUT
    -   DELETE

    POST is the default method for an outbound endpoint.

-   <b>ignoreFailures</b>

    Data type: list of HttpStatusCode objects

    An array containing HTTP status codes to ignore. When the endpoint returns one of the specified non-200 HTTP status codes in `ignoreFailures[]`, we ignore the error. The response data includes the error code and message.

    The `bestEffort` attribute overrides `ignoreFailures`. If you set `bestEffort` to `true`, we ignore all unsuccessful HTTP codes (codes outside of the 200 code range).

    An array item consists of these attributes:

    -   `code` - (Required) The HTTP error code to ignore.
    -   `codeName` - (Informational only) Describes the status code. Use this field for your information only; it has no effect.

    Example:

    ```
    "ignoreFailures": [
          {"code": 404,
           "codeName": "Not found"}
    ]
    ```

    Specify any of these HTTP status codes that Presentation Components can ignore. By default, Presentation Components treat these status codes as errors and ignore all other status codes not listed here:

    -   301 - Moved permanently.
    -   302 - Found.
    -   303 - See other.
    -   307 - Temporary redirect.
    -   401 - Unauthorized.
    -   404 - Not found.
    -   407 - Proxy authentication required.
    -   408 - Request timeout.
    -   500 - Internal server error.
    -   503 - Service unavailable.

    For the standard descriptions of the status codes, see [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status).

    If you don't include the listed status codes in `ignoreFailures`, Presentation Components treat them as errors. If you configured custom error pages in your app, Presentation Components route the errors to the custom error pages. See [Reference: Custom Error Pages](/wcp_docs/vfx1525988737823.html).

    To treat any of the HTTP status codes <i>not</i> listed above as error, specify the status code in the `failOnStatusCodes` attribute.

-   <b>multiPartFileLast</b>

    Data type: boolean

    If true, the outbound endpoint sends the file part as the last part of the multipart form request. Default is false.

    Set `multiPartFileLast` to true for outbound endpoints that:

    -   Use the `multipart/form-data` content type.
    -   Include both JSON data and file as multiple `form-data` subparts.
    -   Require that the file subpart is the last section of the `multipart/form-data` request.

    This sample endpoint sets the file attachment as the last section in the multipart request:

    ```
    {
    "name": "charityImage",
    "baseUrlType": "app",
    "url": "charityImages",
    "httpMethod": "POST",
    "authType": "sso",
    "exclude": "<% empty(imageFileUploader.children) %>",
    "multiPartFileLast": true
    }
    ```

    The resulting sample multipart request looks like:

    ```
    content-type: multipart/form-data; boundary=sampleBoundary
    --sampleBoundary
    Content-Disposition: form-data; name="data"
    Content-Type: text/plain
    {
    "file":"cid:image",
    "uploadedBy":"3aa5550b7fe348b98d7b5741afc65534",
    "uploadedDate":"06/26/2019"
    }
    --sampleBoundary
    Content-Disposition: form-data; name="image"; filename="<uploadedFileFromFileUploader>"
    Content-Type: text/plain
    
    <uploadedFileFromFileUploader>
    
    --sampleBoundary--
    ```

-   <b>name</b>

    Data type: string

    The unique name of this endpoint. Use this name to reference the endpoint in your PMDs. You can access the data returned by this endpoint with the syntax `name.someFieldName`.

-   <b>updateId</b>

    Data type: binding-String

    The instance ID used by the update operation specified in the `updateUrl` attribute.

    To update an existing instance instead of creating a new instance from a `panelList` or `grid`, specify both `updateId` and `updateUrl`.

-   <b>updateUrl</b>

    Data type: string

    The URL endpoint for an update operation. The `updateUrl` attribute uses the `PUT` HTTP method.

    To update an existing instance instead of creating a new instance from a `panelList` or `grid`, specify both `updateId` and `updateUrl`.

    This sample outbound endpoint uses `POST /entries` for adding a new instance from a grid, and uses `PUT /entries/{id}` for updating an existing instance:

    ```
    {
    "name": "addOrUpdateExpense",
    "authType": "SSO",
    "url": "/entries",
    "baseUrlType": "workday-expense",
    "updateId": "<% entryId.value %>",
    "updateUrl": "/entries/<% string:urlEncode(entryId.value) %>"
    }
    ```

-   <b>url</b>

    Data type: binding-String

    The relative endpoint URL of the REST API resource. We append the `url` attribute to `baseUrlType` to get the full API endpoint.

    You can only use HTTP/HTTPS as the URL protocol for an endpoint. Workday recommends always using HTTPS.

-   <b>values</b>

    Data type: list of value objects

    An array of outbound fields with their corresponding values in the request body of an outbound endpoint.

    In this example, we send these outbound fields to the sample <i>charity</i> outbound endpoint: <i>createdBy.id</i> and <i>image.id</i>. Their values come from 2 endpoints, <i>worker</i> and <i>charityImage</i>, respectively.

    ```
    {
    "name": "charity",
    "baseUrlType": "app",
    "url": "charities",
    "httpMethod": "POST",
    "authType": "sso",
    "values": [
      {
        "outboundPath": "createdBy.id",
        "value": "<% worker.id %>"
      },
      {
        "outboundPath": "image.id",
        "value": "<% (!empty(charityImage.id)) ? charityImage.id : null %>"
      }
    ]
    }
    ```

    Here's the resulting request body sent to the <i>charity</i> outbound endpoint:

    ```
    {
     "createdBy":{
        "id":"3aa5550b7fe348b98d7b5741afc65534"
     },
     "image":{
        "id":"579ce125c1e010477a6665a4cf6535f6"
     }
    }
    ```



## <a id="section_pmdScriptingMethods"></a>PMD Scripting Methods

-   <b>invoke()</b>

    Return type: `Object`

    Description: Invokes an inbound endpoint without parameters, and returns the endpoint response. To reference the JSON fields in the returned object, save the returned object in a variable. For an example, see `invoke(Map arguments)`.

-   <b>invoke(Map arguments)</b>

    Return type: `Object`

    Description: Invokes an inbound endpoint with named parameters, and returns the endpoint response. To reference the JSON fields in the returned object, save the returned object in a variable.

    This sample script invokes the <i>getWorkerById</i> endpoint with the <i>id</i> parameter, and saves the returned object in <i>workerData</i>. It then uses the <i>workerData.person.email</i> field to populate the <i>workerEmailAddress</i> widget:

    ```
    
    // Invoke endpoint and pass id as a URL parameter
           var populateEmail = function(selectedWorkerId) {
               if( !(empty selectedWorkerId)) {
                   var workerData = getWorkerById.invoke({'id': selectedWorkerId});
                   workerEmailAddress.value = workerData.person.email;
               }
           };
    ```

    The sample <i>getWorkerById</i> endpoint with the <i>id</i> path parameter:

    ```
    {
       "name": "getWorkerById",
       "baseUrlType": "workday-staffing",
       "url": "<% '/workers/' + id %>",
       "authType": "sso",
       "deferred": true,
       "responseErrorDetail": {
         "errorSummary": "<% [error].addAll(errors.map(e => {e.error})).join('\\n') %>"
       }
    }
    ```

    This sample JSON shows the content of the <i>workerData</i> variable, which is the response data from the <i>getWorkerById</i> endpoint.

    ```
    {
      "descriptor": "Logan McNeil",
      "id": "3aa5550b7fe348b98d7b5741afc65534",
      "person": {
        "email": "lmcneil@workday.net",
        "id": "9feb1da3167840a9852698a2f228f795",
        "phone": "+1415789-8904"
      },
      ...
    }
    ```



## <a id="section_pmdScriptingEvents"></a>PMD Scripting Events

-   <b>onMultiPartSend</b>

    Triggers just before sending data to a multipart outbound endpoint, enabling you to modify the JSON parts of a multipart request, such as file metadata. The `onMultiPartSend` event triggers when at least 1 widget specifies the `valueOutBinding` attribute with a form-data part. The `valueOutBinding` for a multipart endpoint uses either format:

    -   `<outboundEndpointName>:<formDataName>` - The `valueOutBinding` format on a `fileUploader`.
    -   `<outboundEndpointName>:<formDataName>:<jsonFieldName>` - The `valueOutBinding` format on any other widget.

    The `onMultiPartSend` event applies only to `outboundEndPoints` that:

    -   Are multipart endpoints.
    -   Use the POST or PUT methods.

    Use the `onMultiPartSend` event to manipulate and return `self.data`, which is a map containing the JSON parts of the multipart request. Each JSON part is a <<i>formDataName</i>, <i>Object</i>> pair where:

    -   <i>formDataName</i> - The name that identifies the part. Specify the <i>formDataName</i> in the `valueOutBinding`. You can't use "`metadata`" as the <i>formDataName</i>.
    -   <i>Object</i> - A map or array of JSON fields representing the data part.

    <b>Notes</b>:

    -   If the PMD script returns an empty or null `self.data`, only the uploaded files are sent to the outbound endpoint, which might fail without the data part.
    -   If you're debugging an `onMultiPartSend` event handler with a `console` method, ensure that the `console` method isn't the last line of the script. The last line must be `self.data`.

    See the `onMultiPartSend` examples in:

    -   [Concept: fileUploader](/wcp_docs/ttn1652370891576.html)
    -   [Concept: Submitting Data](/wcp_docs/rmd1572291186381.html)

-   <b>onSend</b>

    Triggers just before sending the request data to an outbound endpoint or a POST inbound endpoint. Specify a PMD script that returns either a List or a Map, which is the request JSON data. The `onSend` event handler can reference all widget values on the page, including composite widgets such as `grid` rows or `panelList` panels.

    <b>Notes:</b>

    -   An `onSend` event handler that returns `null` prevents the invocation of a POST, PATCH, or PUT endpoint. However, the `null` return value still invokes a DELETE endpoint, which doesn't need a request payload.
    -   If you're debugging an `onSend` event handler with a `console` method, ensure that the `console` method isn't the last line of the script. The last line of the `onSend` event handler must be `self.data`.
    -   The `onSend` event doesn't support multipart outbound endpoints, such as endpoints that submit file attachments. For multipart outbound endpoints, use the `onMultiPartSend` event.
    -   For outbound endpoints, `onSend` always executes, and `self.data` includes the data from the `values` attribute.

    This snippet uses a `text` with `valueOutBinding`, and an `outboundEndPoint` with `onSend`. The `onSend` script calls a sample function `getNewTitle()` to populate the `proposedBusinessTitle` before returning `self.data`. The `self.data` variable contains a JSON Map with the `proposedBusinessTitle` and `descriptor` fields.

    ```
    {
      "type": "text",
      "id": "currentBusinessTitle",
      "label": "Business Title",
      "value": "<% workerData.businessTitle %>",
      "valueOutBinding":"businessTitleChange.proposedBusinessTitle"
    },
    {
      "type": "text",
      "id": "name",
      "label": "Name",
      "value": "<% workerData.descriptor %>"
    },
    . . .
    "outboundData": {
        "outboundEndPoints": [
          {
            "name": "businessTitleChange",
            "baseUrlType": "workday-common",
            "url": "<% '/workers/' + queryParams.workerId + '/businessTitleChanges' %>",
            "httpMethod": "POST",
            "authType": "sso",
            "onSend": "<%
               self.data.proposedBusinessTitle = getNewTitle();
               self.data.descriptor = 'Title Change : ' + name.value;
               self.data;
            %>"
          }
        ]
    },
    ```

    Note that the sample `onSend` event handler includes the `descriptor` field to demonstrate that you can update any outbound JSON field in the event handler. The `POST workers/{id}/businessTitleChange` API ignores the `descriptor` field and automatically sets it.

    This snippet uses a `text` tag without a `valueOutBinding`, and an `outboundEndPoint` with `onSend`. The `onSend` script returns a JSON Map containing the `proposedBusinessTitle` and `descriptor` fields. Their values reference the `text` widget values.

    ```
    {
      "type": "text",
      "id": "title",
      "label": "Business Title",
      "value": "<% workerData.businessTitle %>"
    },
    {
      "type": "text",
      "id": "name",
      "label": "Name",
      "value": "<% workerData.descriptor %>"
    },
    . . .
    "outboundData": {
        "outboundEndPoints": [
          {
            "name": "businessTitleChange",
            "baseUrlType": "workday-common",
            "url": "<% '/workers/' + queryParams.workerId + '/businessTitleChanges' %>",
            "httpMethod": "POST",
            "authType": "sso",
            "onSend": "<%
               {
                 'proposedBusinessTitle' : getNewTitle(),
                 'descriptor' : 'Title Change : ' + name.value
               };
            %>"
          }
        ]
    },
    ```

    Note that the sample `onSend` event handler includes the `descriptor` field to demonstrate that you can update any outbound JSON field in the event handler. The `POST workers/{id}/businessTitleChange` API ignores the `descriptor` field and automatically sets it.



### Related Information

[Concept: Submitting Data](/wcp_docs/rmd1572291186381.html)

[App Catalog: Charitable Donations](/app-catalog/charitableDonations)

