arazzo: 1.0.1
info:
title: Amazon Connect Search and Inspect Contact
summary: Search contacts in a time range, then describe and read the attributes of the first match.
description: >-
Finds a recent contact and pulls its detail. The workflow searches contacts
in the instance over a time range, branches on whether any contacts were
returned, and for the first match describes the contact and reads its
user-defined attributes. Every step spells out its request inline so the flow
can be read and executed without opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: contactsApi
url: ../openapi/amazon-connect-contacts-api-openapi.yml
type: openapi
workflows:
- workflowId: search-and-inspect-contact
summary: Search contacts and inspect the first match.
description: >-
Searches contacts over a time range and, when at least one is found,
describes it and retrieves its attributes.
inputs:
type: object
required:
- instanceId
- startTime
- endTime
properties:
instanceId:
type: string
description: The identifier of the Amazon Connect instance.
startTime:
type: string
description: The inclusive start of the search time range (ISO 8601).
endTime:
type: string
description: The exclusive end of the search time range (ISO 8601).
maxResults:
type: integer
description: The maximum number of contacts to return.
steps:
- stepId: SearchContacts
description: >-
Search contacts by initiation timestamp over the supplied time range.
operationId: SearchContacts
requestBody:
contentType: application/json
payload:
InstanceId: $inputs.instanceId
TimeRange:
Type: INITIATION_TIMESTAMP
StartTime: $inputs.startTime
EndTime: $inputs.endTime
MaxResults: $inputs.maxResults
successCriteria:
- condition: $statusCode == 200
outputs:
firstContactId: $response.body#/Contacts/0/Id
totalCount: $response.body#/TotalCount
onSuccess:
- name: contactsFound
type: goto
stepId: DescribeContact
criteria:
- context: $response.body
condition: $.Contacts[0]
type: jsonpath
- name: noContacts
type: end
- stepId: DescribeContact
description: >-
Describe the first contact returned by the search.
operationId: DescribeContact
parameters:
- name: InstanceId
in: path
value: $inputs.instanceId
- name: ContactId
in: path
value: $steps.SearchContacts.outputs.firstContactId
successCriteria:
- condition: $statusCode == 200
outputs:
contactRecord: $response.body#/Contact
channel: $response.body#/Contact/Channel
- stepId: getAttributes
description: >-
Retrieve the user-defined attributes for the inspected contact.
operationId: GetContactAttributes
parameters:
- name: InstanceId
in: path
value: $inputs.instanceId
- name: InitialContactId
in: path
value: $steps.SearchContacts.outputs.firstContactId
successCriteria:
- condition: $statusCode == 200
outputs:
attributes: $response.body#/Attributes
outputs:
firstContactId: $steps.SearchContacts.outputs.firstContactId
channel: $steps.DescribeContact.outputs.channel
attributes: $steps.getAttributes.outputs.attributes
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.