PutProfileObject
Adds additional objects to customer profiles of a given ObjectType.
When adding a specific profile object, like a Contact Record, an inferred profile can get created if it is not mapped to an existing profile. The resulting profile will only have a phone number populated in the standard ProfileObject. Any additional Contact Records with the same phone number will be mapped to the same inferred profile.
When a ProfileObject is created and if a ProfileObjectType already exists for the ProfileObject, it will provide data to a standard profile depending on the ProfileObjectType definition.
PutProfileObject needs an ObjectType, which can be created using PutProfileObjectType.
Request Syntax
PUT /domains/DomainName
/profiles/objects HTTP/1.1
Content-type: application/json
{
"Object": "string
",
"ObjectTypeName": "string
"
}
URI Request Parameters
The request uses the following URI parameters.
- DomainName
-
The unique name of the domain.
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
^[a-zA-Z0-9_-]+$
Required: Yes
Request Body
The request accepts the following data in JSON format.
- Object
-
A string that is serialized from a JSON object.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256000.
Required: Yes
- ObjectTypeName
-
The name of the profile object type.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Pattern:
^[a-zA-Z_][a-zA-Z_0-9-]*$
Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"ProfileObjectUniqueKey": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ProfileObjectUniqueKey
-
The unique identifier of the profile object generated by the service.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- BadRequestException
-
The input you provided is invalid.
HTTP Status Code: 400
- InternalServerException
-
An internal service error occurred.
HTTP Status Code: 500
- ResourceNotFoundException
-
The requested resource does not exist, or access was denied.
HTTP Status Code: 404
- ThrottlingException
-
You exceeded the maximum number of requests.
HTTP Status Code: 429
Examples
Example 1: For a custom object
This example illustrates one usage of PutProfileObject.
Sample Request
PUT /domains/ExampleDomainName/profiles/objects HTTP/1.1
Content-type: application/json
{
"Object": "{\"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"isAlive\": true,\n \"age\": 27,\n \"address\": {\"streetAddress\": \"21 2nd Street\",\"city\": \"New York\",\"state\": \"NY\",\"postalCode\": \"10021-3100\"},\n \"phoneNumbers\": [{\"type\": \"home\",\"number\": \"212 555-1234\"},\n {\"type\": \"office\",\"number\": \"646 555-4567\"}],\n \"children\": [],\n \"spouse\": null}",
"ObjectTypeName": "MyCustomObjectName"
}
Sample Response
Content-type: application/json
{
"ProfileObjectUniqueKey": "HashValueOfUniqueKeyOfTheProfileObject"
}
Example 2: For a pre-defined object, like a Contact Record
This example illustrates one usage of PutProfileObject.
Sample Request
PUT /domains/ExampleDomainName/profiles/objects HTTP/1.1
Content-type: application/json
{
"Object": "{\n \"mediaStreams\": [\n {\n \"type\": \"AUDIO\"\n }\n ],\n \"queue\": null,\n \"preDisconnectState\": null,\n \"references\": null,\n \"contactReferences\": null,\n \"initialContactId\": null,\n \"previousContactData\": null,\n \"recordings\": null,\n \"contactDetails\": null,\n \"initialContactFlowId\": \"e1b44e46-a457-4230-a896-64473a2dbe7d\",\n \"channel\": \"VOICE\",\n \"attributes\": null,\n \"customerEndpoint\": {\n \"address\": null,\n \"type\": \"VOIP\",\n \"arn\": null\n },\n \"transferInfo\": null,\n \"initiationMethod\": \"API\",\n \"nextContactData\": null,\n \"contactId\": \"9a3394ee-a0c4-448a-a329-9a148e53d8cd\",\n \"initiationTimestamp\": 1603319514474,\n \"connectedToSystemTimestamp\": 1603319517218,\n \"disconnectTimestamp\": 1603319517000,\n \"agentConnectionAttempts\": 0,\n \"agent\": null,\n \"systemEndpoint\": {\n \"address\": \"e1b44e46-a457-4230-a896-64473a2dbe7d\",\n \"type\": \"CONTACT_FLOW\",\n \"arn\": null\n },\n \"instanceARN\": \"arn:aws:connect:us-west-2:941081270797:instance/fb129b8c-4a2f-4561-859b-cc190fa047b1\",\n \"lastUpdateTimestamp\": 1603319579763,\n \"disconnectReason\": \"CUSTOMER_DISCONNECT\",\n \"awsaccountId\": \"941081270797\",\n \"awscontactTraceRecordFormatVersion\": \"2019-01-23\"\n}",
"ObjectTypeName": "CTR"
}
Sample Response
Content-type: application/json
{
"ProfileObjectUniqueKey": "HashValueOfTheCTRContactId"
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: