Scout RFP (Workday Strategic Sourcing) attachments API

Use the attachments API to create, update, and delete the attachments in Workday Strategic Sourcing. ## Working with Attachments Creating attachments for Workday Strategic Sourcing objects is a two-step process. First, you need to inform the system about your intention to upload an attachment by issuing a "Create an Attachment" request, consisting of the file name and a link to the object to which you are adding an attachment. The link is represented by a relationship object containing an object ID and its type. In the response you will receive a link in the `upload_url` attributes, along with required HTTP headers to send with your file. You will need to upload your file as a binary stream in a PUT request into the specified URL, making sure the required headers are present. Here is how the workflow might look like when triggered from a console: ```bash $ curl -H "X-Api-Key: ${COMPANY_KEY}" \ -H "X-User-Token: ${USER_TOKEN}" \ -H "X-User-Email: ${USER_EMAIL}" \ -H "Content-Type: application/vnd.api+json" \ -X POST \ -d ' { "data": { "type": "attachments", "attributes": { "title": "My Interesting Document", "file_name": "Some Interesting File.pdf" }, "relationships": { "contract": { "data": { "id": 1, "type": "contracts" } } } } } ' \ "https://api.us.workdayspend.com/services/attachments/v1/attachments" { "data": { "id": "1", "type": "attachments", "attributes": { "title": "My Interesting Document", "file_size": null, "upload_url": "https://upload.s3.amazonaws.com/uploads/contract/1/hex/file.pdf?some=very&long=url", "upload_headers": [ { "name": "Content-Type", "value": "application/octet-stream" }, { "name": "x-amz-acl", "value": "private" }, { "name": "x-amz-server-side-encryption", "value": "AES256" }, { "name": "Content-Disposition", "value": "attachment" } ] } } } $ curl -X PUT \ --data "@file.pdf" \ -H "Content-Type: application/octet-stream" \ -H "x-amz-acl: private" \ -H "x-amz-server-side-encryption: AES256" \ -H "Content-Disposition: attachment" \ https://upload.s3.amazonaws.com/uploads/contract/1/hex/file.pdf?some=very&long=url ``` The upload URL expires within 15 minutes after issuing. Please note that you will not be able to upload the data file to the attachment object after that. An automated system will purge all partial uploads after a certain period (usually within 30-60 minutes after creation) to prevent orphan records from overflowing the system. **Please Note**: The list of headers and their values might change at any time, so when you're implementing an integration with the Workday Strategic Sourcing system, make sure to include all of the HTTP headers returned from the attachments endpoint. ## Attachment Object

OpenAPI Specification

scoutrfp-attachments-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Workday Strategic Sourcing attachments API
  version: '1.0'
  description: '<span id="section/Authentication/api_key" data-section-id="section/Authentication/api_key"></span>

    <span id="section/Authentication/user_token" data-section-id="section/Authentication/user_token"></span>

    <span id="section/Authentication/user_email" data-section-id="section/Authentication/user_email"></span>

    '
servers:
- url: https://api.us.workdayspend.com/services/attachments/v1
  description: Production Server
- url: https://api.sandbox.us.workdayspend.com/services/attachments/v1
  description: Sandbox Server
security:
- api_key: []
  user_token: []
  user_email: []
tags:
- name: attachments
  x-displayName: Attachments
  description: "Use the attachments API to create, update, and delete the attachments in Workday Strategic Sourcing.\n\n## Working with Attachments\n\nCreating attachments for Workday Strategic Sourcing objects is a two-step process. First, you need to inform\nthe system about your intention to upload an attachment by issuing a \"Create an Attachment\" request,\nconsisting of the file name and a link to the object to which you are adding an attachment. The link\nis represented by a relationship object containing an object ID and its type.\n\nIn the response you will receive a link in the `upload_url` attributes, along with required HTTP headers\nto send with your file. You will need to upload your file as a binary stream in a PUT request into the\nspecified URL, making sure the required headers are present. Here is how the workflow might look\nlike when triggered from a console:\n\n```bash\n$ curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n       -H \"X-User-Token: ${USER_TOKEN}\" \\\n       -H \"X-User-Email: ${USER_EMAIL}\" \\\n       -H \"Content-Type: application/vnd.api+json\" \\\n       -X POST \\\n       -d '\n         {\n           \"data\": {\n             \"type\": \"attachments\",\n             \"attributes\": {\n               \"title\": \"My Interesting Document\",\n               \"file_name\": \"Some Interesting File.pdf\"\n             },\n             \"relationships\": {\n               \"contract\": {\n                 \"data\": {\n                   \"id\": 1,\n                   \"type\": \"contracts\"\n                 }\n               }\n             }\n           }\n         }\n       ' \\\n       \"https://api.us.workdayspend.com/services/attachments/v1/attachments\"\n\n{\n    \"data\": {\n        \"id\": \"1\",\n        \"type\": \"attachments\",\n        \"attributes\": {\n            \"title\": \"My Interesting Document\",\n            \"file_size\": null,\n            \"upload_url\": \"https://upload.s3.amazonaws.com/uploads/contract/1/hex/file.pdf?some=very&long=url\",\n            \"upload_headers\": [\n                {\n                    \"name\": \"Content-Type\",\n                    \"value\": \"application/octet-stream\"\n                },\n                {\n                    \"name\": \"x-amz-acl\",\n                    \"value\": \"private\"\n                },\n                {\n                    \"name\": \"x-amz-server-side-encryption\",\n                    \"value\": \"AES256\"\n                },\n                {\n                    \"name\": \"Content-Disposition\",\n                    \"value\": \"attachment\"\n                }\n            ]\n        }\n    }\n}\n\n$ curl -X PUT \\\n    --data \"@file.pdf\" \\\n    -H \"Content-Type: application/octet-stream\" \\\n    -H \"x-amz-acl: private\" \\\n    -H \"x-amz-server-side-encryption: AES256\" \\\n    -H \"Content-Disposition: attachment\" \\\n    https://upload.s3.amazonaws.com/uploads/contract/1/hex/file.pdf?some=very&long=url\n```\n\nThe upload URL expires within 15 minutes after issuing. Please note that you will not be able to upload\nthe data file to the attachment object after that. An automated system will purge all partial uploads\nafter a certain period (usually within 30-60 minutes after creation) to prevent orphan records from\noverflowing the system.\n\n**Please Note**: The list of headers and their values might change at any time, so when you're\nimplementing an integration with the Workday Strategic Sourcing system, make sure to include all of the HTTP headers\nreturned from the attachments endpoint.\n\n## Attachment Object\n\n<SchemaDefinition schemaRef=\"#/components/schemas/Attachment\" showReadOnly={true} showWriteOnly={true} />\n"
paths:
  /attachments:
    get:
      tags:
      - attachments
      description: 'Returns a filtered list of attachments based of the `filter[id_equals]` mandatory param.

        The result is limited to **50** attachments.

        '
      operationId: List Attachments
      summary: List Attachments
      parameters:
      - name: filter
        in: query
        description: 'Filter attachments by multiple criteria.

          '
        schema:
          $ref: '#/components/schemas/AttachmentInputFilter'
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Attachment'
              examples:
                success:
                  $ref: '#/components/examples/index_response'
        '401':
          description: Unauthorized
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     \"https://api.us.workdayspend.com/services/attachments/v1/attachments\"\n"
    post:
      tags:
      - attachments
      description: 'Create an attachment for an object. This endpoint represents the first step in the two-step

        upload workflow, described in the [Working with Attachments](#section/Working-with-Attachments)

        section.


        The only required attribute is `file_name`, which will be used to generate attachment title

        (if a custom one is not supplied), and the upload URL. You will also need to specify the object

        to which you want to add an attachment (see `relationships` property).

        '
      operationId: Create an Attachment
      summary: Create an Attachment
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/AttachmentCreate'
            examples:
              success:
                $ref: '#/components/examples/create_request'
      responses:
        '201':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AttachmentUpload'
              examples:
                success:
                  $ref: '#/components/examples/create_response'
        '401':
          description: Unauthorized
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X POST \\\n     -d '\n       {\n         \"data\": {\n           \"type\": \"attachments\",\n           \"attributes\": {\n             \"title\": \"My Interesting Document\",\n             \"file_name\": \"Some Interesting File.pdf\",\n             \"external_id\": \"AT1\"\n           },\n           \"relationships\": {\n             \"contract\": {\n               \"data\": {\n                 \"id\": 1,\n                 \"type\": \"contracts\"\n               }\n             }\n           }\n         }\n       }\n     ' \\\n     \"https://api.us.workdayspend.com/services/attachments/v1/attachments\"\n"
  /attachments/{id}:
    get:
      tags:
      - attachments
      description: 'Retrieves the details of an existing attachment. You need to supply the unique attachment identifier that was returned upon attachment creation.

        '
      operationId: Get an Attachment
      summary: Get an Attachment
      parameters:
      - name: id
        in: path
        description: Unique attachment identifier.
        required: true
        schema:
          type: integer
        example: 1
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Attachment'
              examples:
                success:
                  $ref: '#/components/examples/show_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     \"https://api.us.workdayspend.com/services/attachments/v1/attachments/1\"\n"
    patch:
      tags:
      - attachments
      description: 'Update an attachment for an object. This endpoint represents the first step in the two-step

        update upload workflow, described in the [Working with Attachments](#section/Working-with-Attachments)

        section.


        New `upload_url` and `upload_headers` will be returned when the `file_name` attribute is passed. In this case, the existing `upload_url` will be overridden with a new one that doesn’t have the associated file yet, pending completion of the second step in the described upload process.

        '
      operationId: Update an Attachment
      summary: Update an Attachment
      parameters:
      - name: id
        in: path
        description: Unique attachment identifier.
        required: true
        schema:
          type: integer
        example: 1
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/AttachmentUpdate'
            examples:
              success:
                $ref: '#/components/examples/update_request'
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AttachmentUpload'
              examples:
                success:
                  $ref: '#/components/examples/update_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '409':
          description: Conflict
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                invalid_type:
                  summary: Missing or invalid 'type' specified, expected 'attachments'
                  description: 'Returns error due to invalid `type` parameter.

                    '
                  value:
                    errors:
                    - detail: Missing or invalid 'type' specified, expected 'attachments'
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X PATCH \\\n     -d '\n       {\n         \"data\": {\n           \"id\": \"1\",\n           \"type\": \"attachments\",\n           \"attributes\": {\n             \"title\": \"My Interesting Document\",\n             \"file_name\": \"Some Interesting File.pdf\"\n           }\n         }\n       }\n     ' \\\n     \"https://api.us.workdayspend.com/services/attachments/v1/attachments/1\"\n"
  /attachments/{external_id}/external_id:
    get:
      tags:
      - attachments
      description: 'Retrieves the details of an existing attachment. You need to supply the unique attachment identifier (external ID) that was set during attachment creation.

        '
      operationId: Get an Attachment by External ID
      summary: Get an Attachment by External ID
      parameters:
      - name: external_id
        in: path
        description: Unique attachment external identifier.
        required: true
        schema:
          type: string
        example: AT1
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Attachment'
              examples:
                success:
                  $ref: '#/components/examples/external_show_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     \"https://api.us.workdayspend.com/services/attachments/v1/attachments/AT1/external_id\"\n"
    patch:
      tags:
      - attachments
      description: 'Update an attachment for an object. This endpoint represents the first step in the two-step

        update upload workflow, described in the [Working with Attachments](#section/Working-with-Attachments)

        section.


        New `upload_url` and `upload_headers` will be returned when the `file_name` attribute is passed. In this case, the existing `upload_url` will be overridden with a new one that doesn’t have the associated file yet, pending completion of the second step in the described upload process.

        '
      operationId: Update an Attachment by External ID
      summary: Update an Attachment by External ID
      parameters:
      - name: external_id
        in: path
        description: Unique attachment external identifier.
        required: true
        schema:
          type: string
        example: AT1
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/AttachmentUpdate'
            examples:
              success:
                $ref: '#/components/examples/external_update_request'
      responses:
        '200':
          description: OK
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AttachmentUpload'
              examples:
                success:
                  $ref: '#/components/examples/external_update_response'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '409':
          description: Conflict
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                invalid_type:
                  summary: Missing or invalid 'type' specified, expected 'attachments'
                  description: 'Returns error due to invalid `type` parameter.

                    '
                  value:
                    errors:
                    - detail: Missing or invalid 'type' specified, expected 'attachments'
      x-codeSamples:
      - label: Curl
        source: "curl -H \"X-Api-Key: ${COMPANY_KEY}\" \\\n     -H \"X-User-Token: ${USER_TOKEN}\" \\\n     -H \"X-User-Email: ${USER_EMAIL}\" \\\n     -H \"Content-Type: application/vnd.api+json\" \\\n     -X PATCH \\\n     -d '\n       {\n         \"data\": {\n           \"id\": \"AT1\",\n           \"type\": \"attachments\",\n           \"attributes\": {\n             \"title\": \"My Interesting Document\",\n             \"file_name\": \"Some Interesting File.pdf\"\n           }\n         }\n       }\n     ' \\\n     \"https://api.us.workdayspend.com/services/attachments/v1/attachments/AT1/external_id\"\n"
components:
  schemas:
    AttachmentContractRelationship:
      title: Contract
      type: object
      description: Contract relationship.
      required:
      - contract
      properties:
        contract:
          type: object
          properties:
            data:
              $ref: '#/components/schemas/ContractBase'
    EventBase:
      title: Event
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/EventType'
        id:
          $ref: '#/components/schemas/EventId'
    AttachmentId:
      type: integer
      description: Attachment identifier string.
      example: 1
    Attachment:
      allOf:
      - $ref: '#/components/schemas/AttachmentBase'
      - type: object
        properties:
          attributes:
            $ref: '#/components/schemas/AttachmentAttributes'
    ProjectId:
      type: integer
      description: Project identifier string.
      example: 1
    AttachmentAttributesBase:
      type: object
      description: Attachment attributes.
      properties:
        title:
          type: string
          maxLength: 255
          description: Attachment title.
          example: My Contract
        file_name:
          type: string
          description: Attachment file name.
          example: My Contract.pdf
        file_size:
          type: string
          description: Attachment file size in bytes.
          readOnly: true
          example: '1023343'
        external_id:
          type: string
          maxLength: 255
          description: Attachment external identifier.
          example: AT1
    EventType:
      type: string
      description: Object type, should always be `events`.
      example: events
    ContractBase:
      title: Contract
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/ContractTypeValue'
        id:
          $ref: '#/components/schemas/ContractId'
    AttachmentAttributesExtended:
      allOf:
      - $ref: '#/components/schemas/AttachmentAttributesBase'
      - type: object
        properties:
          download_url:
            type: string
            description: Attachment download URL.
            readOnly: true
          download_url_expires_at:
            format: date-time
            description: Download URL expiration time.
            readOnly: true
            example: '2020-08-21T13:26:59.999Z'
          uploaded_by:
            type: string
            description: Email of the uploader.
            readOnly: true
          uploaded_at:
            format: date-time
            description: Time of upload.
            readOnly: true
            example: '2020-08-18T12:48:42.978Z'
    AttachmentCreate:
      type: object
      required:
      - type
      properties:
        type:
          $ref: '#/components/schemas/AttachmentType'
        attributes:
          allOf:
          - $ref: '#/components/schemas/AttachmentAttributesBase'
          - type: object
            required:
            - file_name
        relationships:
          oneOf:
          - $ref: '#/components/schemas/AttachmentContractRelationship'
          - $ref: '#/components/schemas/AttachmentEventRelationship'
          - $ref: '#/components/schemas/AttachmentProjectRelationship'
          - $ref: '#/components/schemas/AttachmentSupplierCompanyRelationship'
    ProjectType:
      type: string
      description: Object type, should always be `projects`.
      example: projects
    AttachmentUpload:
      allOf:
      - $ref: '#/components/schemas/AttachmentBase'
      - type: object
        properties:
          attributes:
            $ref: '#/components/schemas/AttachmentUploadAttributes'
    AttachmentAttributes:
      allOf:
      - $ref: '#/components/schemas/AttachmentAttributesExtended'
      - type: object
        required:
        - file_name
    AttachmentProjectRelationship:
      title: Project
      type: object
      description: Project relationship.
      required:
      - project
      properties:
        project:
          type: object
          properties:
            data:
              $ref: '#/components/schemas/ProjectBase'
    Error:
      type: object
      properties:
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the problem.
    AttachmentUploadAttributes:
      allOf:
      - $ref: '#/components/schemas/AttachmentAttributesBase'
      - type: object
        required:
        - file_name
        properties:
          upload_url:
            type: string
            description: 'Attachment upload URL. Please note, the URL expires within 15 minutes. This attribute

              will only be returned when creating a new attachment.

              '
            readOnly: true
          upload_headers:
            type: array
            description: 'List of required HTTP headers with their values to submit when uploading the attachment file.

              '
            readOnly: true
            items:
              type: object
              properties:
                name:
                  type: string
                  description: HTTP header name.
                value:
                  type: string
                  description: HTTP header value.
    SupplierCompanyId:
      type: integer
      description: Supplier company identifier string.
      example: 1
    ContractTypeValue:
      type: string
      description: Object type, should always be `contracts`.
      example: contracts
    AttachmentBase:
      title: Attachment
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/AttachmentType'
        id:
          $ref: '#/components/schemas/AttachmentId'
    AttachmentType:
      type: string
      description: Object type, should always be `attachments`.
      example: attachments
    ProjectBase:
      title: Project
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/ProjectType'
        id:
          $ref: '#/components/schemas/ProjectId'
    SupplierCompanyBase:
      title: SupplierCompany
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/SupplierCompanyType'
        id:
          $ref: '#/components/schemas/SupplierCompanyId'
    AttachmentUpdate:
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: '#/components/schemas/AttachmentType'
        id:
          $ref: '#/components/schemas/AttachmentId'
        attributes:
          $ref: '#/components/schemas/AttachmentAttributesBase'
    AttachmentEventRelationship:
      title: Event
      type: object
      description: Event relationship.
      required:
      - event
      properties:
        event:
          type: object
          properties:
            data:
              $ref: '#/components/schemas/EventBase'
    SupplierCompanyType:
      type: string
      description: Object type, should always be `supplier_companies`.
      example: supplier_companies
    AttachmentSupplierCompanyRelationship:
      title: Supplier Company
      type: object
      description: Supplier Company relationship.
      required:
      - supplier_company
      properties:
        supplier_company:
          type: object
          properties:
            data:
              $ref: '#/components/schemas/SupplierCompanyBase'
    ContractId:
      type: integer
      description: Contract identifier string.
      example: 1
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    EventId:
      type: integer
      description: Event identifier string.
      example: 1
    AttachmentInputFilter:
      type: object
      properties:
        id_equals:
          type: string
          description: Find attachments by IDs. A comma separated list of IDs to be provided.
          example: 2,5,9
  examples:
    update_response:
      value:
        data:
          id: '1'
          type: attachments
          attributes:
            external_id: AT2
            title: My Updated Test Document
            file_size: null
            upload_url: https://upload.s3.amazonaws.com/uploads/contract/1/hex/Some%20Updated%20Test%20File.pdf?some=very&long=url
            upload_headers:
            - name: Content-Type
              value: application/octet-stream
            - name: x-amz-acl
              value: private
            - name: x-amz-server-side-encryption
              value: AES256
            - name: Content-Disposition
              value: attachment
    index_response:
      value:
        data:
        - id: '1'
          type: attachments
          attributes:
            external_id: AT1
            title: My Test Document
            file_name: my_test_document.pdf
            file_size: '1023343'
            uploaded_at: '2020-08-18T12:48:42.978Z'
            uploaded_by: someone@example.com
            download_url: https://upload.s3.amazonaws.com/uploads/contract/1/hex/Some%20Updated%20Test%20File.pdf?some=very&long=url
            download_url_expires_at: '2020-08-18T13:26:59.999Z'
          links:
            self: ' https://api.us.workdayspend.com/services/attachments/v1/attachments/1'
        - id: '2'
          type: attachments
          attributes:
            external_id: null
            title: My Test Document 2
            file_name: my_test_document_2.pdf
            file_size: '534241'
            uploaded_at: '2020-08-19T12:48:42.978Z'
            uploaded_by: someone@example.com
            download_url: https://upload.s3.amazonaws.com/uploads/contract/2/hex/Some%20Updated%20Test%20File2.pdf?some=very&long=url
            download_url_expires_at: '2020-08-19T13:26:59.999Z'
          links:
            self: ' https://api.us.workdayspend.com/services/attachments/v1/attachments/2'
        links:
          self: https://api.us.workdayspend.com/services/attachments/v1/attachments
        meta:
          count: 2
    update_request:
      value:
        data:
          type: attachments
          id: '1'
          attributes:
            title: My Updated Test Document
            file_name: Some Updated Test File.pdf
            external_id: AT2
    external_update_response:
      value:
        data:
          id: '1'
          type: attachments
          attributes:
            external_id: AT2
            title: My Updated Test Document
            file_size: null
            upload_url: https://upload.s3.amazonaws.com/uploads/contract/1/hex/Some%20Updated%20Test%20File.pdf?some=very&long=url
            upload_headers:
            - name: Content-Type
              value: application/octet-stream
            - name: x-amz-acl
              value: private
            - name: x-amz-server-side-encryption
              value: AES256
            - name: Content-Disposition
              value: attachment
    show_response:
      value:
        data:
          id: '1'
          type: attachments
          attributes:
            external_id: AT1
            title: My Test Document
            file_name: my_test_document.pdf
            file_size: '1023343'
            uploaded_at: '2020-08-18T12:48:42.978Z'
            uploaded_by: someone@example.com
            download_url: https://upload.s3.amazonaws.com/uploads/contract/1/hex/Some%20Updated%20Test%20File.pdf?some=very&long=url
            download_url_expires_at: '2020-08-21T13:26:59.999Z'
          links:
            self: ' https://api.us.workdayspend.com/services/attachments/v1/attachments/1'
    create_request:
      value:
        data:
          type: attachments
          attributes:
            external_id: AT1
            title: My Test Document
            file_name: Some Test File.pdf
          relationships:
            contract:
              data:
                id: 1
                type: contracts
    external_show_response:
      value:
        data:
          id: '1'
          type: attachments
          attributes:
            external_id: AT1
            title: My Test Document
            file_name: my_test_document.pdf
            file_size: '1023343'
            uploaded_at: '2020-08-18T12:48:42.978Z'
            uploaded_by: someone@example.com
            download_url: https://upload.s3.amazonaws.com/uploads/contract/1/hex/Some%20Updated%20Test%20File.pdf?some=very&long=url
            download_url_expires_at: '2020-08-21T13:26:59.999Z'
          links:
            self: ' https://api.us.workdayspend.com/services/attachments/v1/attachments/1'
    external_update_request:
      value:
        data:
          type: attachments
          id: AT1
          attributes:
            title: My Updated Test Document
            file_name: Some Updated Test File.pdf
            external_id: AT2
    create_response:
      value:
        data:
          id: '1'
          type: attachments
          attributes:
            external_id: AT1
            title: My Test Document
            file_size: null
            upload_url: https://upload.s3.amazonaws.com/uploads/contract/1/hex/Some%20Test%20File.pdf?some=very&long=url
            upload_headers:
            - name: Content-Type
              value: application/octet-stream
            - name: x-amz-acl
              value: private
            - name: x-amz-server-side-encryption
              value: AES256
            - name: Content-Disposition
              value: attachment
  securitySchemes:
    api_key:
      type: apiKey
      name: X-Api-Key
      in: header
      description: Company API key.
    user_token:
      type: apiKey
      name: X-User-Token
      in: header
      description: User token.
    user_email:
      type: apiKey
      name: X-User-Email
      in: header
      description: User email.
x-tagGroups:
- name: Getting Started
  tags:
  - support
  - servers
  - api_specification
  - authentication
  - rate_limiting
- name: Attachments
  tags:
  - attachments