Client Data
All client information is stored under the tenant of the API_KEY owner. Furthermore, all changes to client information are tracked and archived, so that client data can be retrieved at any particular point in time.
This is done to enable input comparisons between times different quotes are generated, and even for Errors and Omission (E&O) tracking purposes.
{ "clientId": "220c4020-7f20-4a16-ba51-d0945804dd83", "clientName": "Business Name", "clientType": "COMMERCIAL", "locationCode": "HQ", "clientData": { "client.name": { "type": "ANSWER", "answer": "Business Name", "qid": "client.name" }, "client.phoneNumber": { "type": "ANSWER", "answer": "3121234567", "qid": "client.phoneNumber" }, "client.industry.naics": { "type": "ANSWER", "answer": "451130", "qid": "client.industry.naics" }, "addresses": { "type": "LOOP", "qid": "addresses", "iterations": [ { "iterationId": "f4c41c8d-ffb6-4883-902b-ab6357fc1a54", "answers": { "client.name": { "type": "ANSWER", "qid": "client.name", "answer": "Simple client" }, "client.industry.naics": { "type": "ANSWER", "qid": "client.industry.naics", "answer": "541940" }, "client.address1": { "type": "ANSWER", "qid": "client.address1", "answer": "129 Main St" }, "client.city": { "type": "ANSWER", "qid": "client.city", "answer": "West Chicago" }, "client.state": { "type": "ANSWER", "qid": "client.state", "answer": "IL" }, "client.zipcode": { "type": "ANSWER", "qid": "client.zipcode", "answer": "60185" }, "client.phoneNumber": { "type": "ANSWER", "qid": "client.phoneNumber", "answer": "2342342342" }, "client.email": { "type": "ANSWER", "qid": "client.email", "answer": "john.smith@asdsadas.com" }, "client.website": { "type": "ANSWER", "qid": "client.website", "answer": "" }, "client.contact.phoneNumber": { "type": "ANSWER", "qid": "client.contact.phoneNumber", "answer": "8745234234" }, "client.contact.name": { "type": "ANSWER", "qid": "client.contact.name", "answer": "John Smith" } } } ] } } }
clientId
: Each client is assigned a unique clientId. IfclientId
is specified, then it is expected that an existing client is being updated. If a specified client is not found using thisclientId
a 404:Not Found error is returned.clientType
: Specify if client isCOMMERCIAL
orPERSONAL
locationCode
: If your organization uses locationCodes, this is where you can specify it for a clientclientData
: Array of answer dataqid
: Question identifier (qid) as per question APIanswer
: Answer for the questiontype
: Specify if element is LOOP or ANSWER
Reserved QIDs
The following QIDs are reserved for special use by the platform. They will always be available on all clients.
client.name client.industry.naics client.address1 client.address2 client.city client.state client.zipcode client.phoneNumber client.email client.website client.contact.name client.contact.phoneNumber
Save client data
PUT: https://api.{ENV}.dais.com/ioi/v3/client
curl --location --request PUT 'https://api.{ENV}.dais.com/ioi/v3/client' \ --header 'Authorization: Basic <yourAuthHere>' \ --header 'Content-Type: application/json' \ --data-raw '{ "clientId": "<clientId>", "clientName": "<clientName>", "clientType": "COMMERCIAL", "locationCode": "<locationCode>", "clientData": { "<qid>": { "type": "ANSWER", "answer": "<answer>", "qid": "<qid>" } }'
Post all client data to this endpoint to save it. If clientId
is not specified, it is assumed you are creating a new client. If it is specified, and a client with that id exists, then data provided will clobber any existing data for that client. The same logic applies to the GET_QUOTES
event, new clients can be automatically saved using the data provided for quoting.
Retrieve latest client data
GET: https://api.{ENV}.dais.com/ioi/v3/client/{client_id}/product/{product_id}
curl --location --request GET 'https://api.{ENV}.dais.com/ioi/v3/client/<clientId>/product/<productId>' \ --header 'Authorization: Basic <yourAuthHere>'
Get client data by specifying a clientId
. If client is not found, HTTP 404 is returned.
Retrieve data from specific point in time
GET: https://api.{ENV}.dais.com/ioi/v3/client/{client_id}/product/{product_id}/datetime/{date}
curl --location --request GET 'https://api.{ENV}.dais.com/ioi/v3/client/<clientId>/product/<productId>/datetime/<date>' \ --header 'Authorization: Basic <yourAuthHere>'
To get the state of client data at a specific point in time, specify date
in ISO-8601 format (i.e. 2020-12-14T20:27:56.812Z
)