action callfire_get_contact_history { label: "Find a contact's history" description: "Searches for all texts and calls attributed to a contact. Returns a list of calls and texts a contact has been involved with" provider: callfire method: GET path: "/contacts/{id}/history" encoding: json input: { type: "object" properties: { fields: { type: "string" } id: { type: "integer" format: "int64" } limit: { type: "integer" format: "int32" } offset: { type: "integer" format: "int32" } } required: ["id"] additionalProperties: false } output: { type: "object" description: "Contains history of all calls and texts addressed to a given contact" properties: { calls: { type: "array" description: "List of Call objects addressed to a given contact" items: { type: "object" description: "Represents a call action sent or received by CallFire platform" properties: { agentCall: { type: "boolean" description: "An internal call to an agent" } attributes: { type: "object" description: "Map of user-defined string attributes associated with an action" } batchId: { type: "integer" format: "int64" description: "An id of contact batch associated with an action" } campaignId: { type: "integer" format: "int64" description: "An id of broadcast associated with an action if call is sent as part of call broadcast" } contact: { type: "object" description: "Represents a contact in CallFire platform. Contains info about the people you want to contact. It allows you to store a user-defined properties for each contact" properties: { deleted: { type: "boolean" description: "A deleted contact, deleted contacts are hidden from search results" } externalId: { type: "string" description: "An external id of a contact for syncing with external sources" } externalSystem: { type: "string" description: "External system that external id refers to" } extraPhone1: { type: "string" description: "Phone number in E.164 format (11-digit). Example: 12132000384" } extraPhone2: { type: "string" description: "Phone number in E.164 format (11-digit). Example: 12132000384" } extraPhone3: { type: "string" description: "Phone number in E.164 format (11-digit). Example: 12132000384" } firstName: { type: "string" description: "A first name of a contact" } homePhone: { type: "string" description: "Phone number in E.164 format (11-digit). Example: 12132000384" } id: { type: "integer" format: "int64" description: "An id of a contact" } lastName: { type: "string" description: "A last name of a contact" } mobilePhone: { type: "string" description: "Phone number in E.164 format (11-digit). Example: 12132000384" } properties: { type: "object" description: "Map of user-defined string properties for contact" } workPhone: { type: "string" description: "Phone number in E.164 format (11-digit). Example: 12132000384" } zipcode: { type: "string" description: "A Zip code of a contact" } } } created: { type: "integer" format: "int64" description: "The time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT " } finalCallResult: { type: "string" description: "Result of a call (LA, AM, BUSY, DNC, XFER, NO_ANS, XFER_LEG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED, SD, POSTPONED, ABANDONED, SKIPPED). See [call states and results](https://developers.callfire.com/results-responses-errors.html)" enum: ["LA", "AM", "BUSY", "DNC", "XFER", "NO_ANS", "XFER_LEG", "INTERNAL_ERROR", "CARRIER_ERROR", "CARRIER_TEMP_ERROR", "UNDIALED", "SD", "POSTPONED", "ABANDONED", "SKIPPED"] } fromNumber: { type: "string" description: "A sender's phone number in E.164 (11-digit) format" } id: { type: "integer" format: "int64" description: "An id of an action" } inbound: { type: "boolean" description: "Is action inbound" } labels: { type: "array" description: "Labels associated with action or broadcast for this action" items: { type: "string" } } modified: { type: "integer" format: "int64" description: "The time when the given resource was modified, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT " } notes: { type: "array" description: "Notes of call added by an agent" items: { type: "object" description: "Represents a note which can be added to a call" properties: { created: { type: "integer" format: "int64" description: "The time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000" } text: { type: "string" description: "A text of a note" } } } } records: { type: "array" description: "List of call records, each record contains call details like originate time, duration, cost, notes made by agents. A single contact may have a multiple phone numbers. In this case if given call was sent as a part of broadcast with configured retry logic then each call record will contain details about attempted phone number" items: { type: "object" description: "Represents a call sent to a contact's number" properties: { answerTime: { type: "integer" format: "int64" description: "Timestamp when call was answered, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT" } billedAmount: { type: "number" format: "float" description: "A cost of the call" } callerName: { type: "string" description: "~" } duration: { type: "integer" format: "int64" description: "Duration of the call in seconds" } finishTime: { type: "integer" format: "int64" description: "Timestamp when call was finished, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT" } id: { type: "integer" format: "int64" description: "An id of a call record" } labels: { type: "array" description: "Labels associated with a call action" items: { type: "string" } } notes: { type: "array" description: "Notes of call added by agent" items: { type: "object" additionalProperties: true } } originateTime: { type: "integer" format: "int64" description: "A date and time (timestamp) when call was originated by CallFire platform and went to downstream provider, formatted in unix time milliseconds (read only). Example: 1473781817000 " } questionResponses: { type: "array" description: "Notes of call added by an agent" items: { type: "object" description: "Object represents the question and client's answer, used in cloud call center / IVR campaign" properties: { question: { type: "string" description: "A text of a question" } response: { type: "string" description: "Client's answer" } } } } recordings: { type: "array" description: "A list of voice recordings of the call" items: { type: "object" description: "Represents a recording of a voice call" properties: { callId: { type: "integer" format: "int64" description: "An id of a call action" } campaignId: { type: "integer" format: "int64" description: "Contains broadcast id if call was sent as a part of voice broadcast" } created: { type: "integer" format: "int64" description: "The time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT" } hash: { type: "string" description: "A unique string hash identifier of a recording" } id: { type: "integer" format: "int64" description: "An id of a call recording" } lengthInBytes: { type: "integer" format: "int64" description: "A size of a recording file in bytes" } lengthInSeconds: { type: "integer" format: "int32" description: "Duration of a recording in seconds" } mp3Url: { type: "string" description: "A public URL of a call recording" } name: { type: "string" description: "A name of a recording" } state: { type: "string" description: "Current state of a recording, available values: RECORDING - recording is in progress, READY - recording is ready, ERROR - error has occurred and recording can be broken" enum: ["RECORDING", "READY", "ERROR"] } } } } result: { type: "string" description: "~" enum: ["LA", "AM", "BUSY", "DNC", "XFER", "NO_ANS", "XFER_LEG", "INTERNAL_ERROR", "CARRIER_ERROR", "CARRIER_TEMP_ERROR", "UNDIALED", "SD", "POSTPONED", "ABANDONED", "SKIPPED"] } switchId: { type: "string" description: "~" } toNumber: { type: "string" description: "A phone number to which a call was addressed. Phone number in E.164 format (11-digit). Example: 12132000384" } } } } state: { type: "string" description: "State of an action (READY, SELECTED, CALLBACK, DISABLED, FINISHED, DNC, DUP, INVALID, TIMEOUT, PERIOD_LIMIT). See [call states and results](https://developers.callfire.com/results-responses-errors.html)" enum: ["READY", "SELECTED", "CALLBACK", "FINISHED", "DISABLED", "SKIPPED", "DNC", "DUP", "INVALID", "TIMEOUT", "PERIOD_LIMIT", "RESTRICTED_NUMBER"] } toNumber: { type: "string" description: "A recipient's phone number in E.164 (11-digit) format" } } } } id: { type: "integer" format: "int64" description: "An id of a contact" } texts: { type: "array" description: "List of Text objects addressed to a given contact" items: { type: "object" description: "Represents a text action sent or received by CallFire platform" properties: { attributes: { type: "object" description: "Map of user-defined string attributes associated with an action" } batchId: { type: "integer" format: "int64" description: "An id of contact batch associated with an action" } campaignId: { type: "integer" format: "int64" description: "An id of broadcast if given text was sent as a part of text broadcast" } contact: { type: "object" additionalProperties: true } created: { type: "integer" format: "int64" description: "The time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT" } finalTextResult: { type: "string" description: "Result of text (SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED). See [call states and results](https://developers.callfire.com/results-responses-errors.html)" enum: ["SENT", "RECEIVED", "DNT", "TOO_BIG", "INTERNAL_ERROR", "CARRIER_ERROR", "CARRIER_TEMP_ERROR", "UNDIALED", "INVALID_NUMBER"] } fromNumber: { type: "string" description: "Sender's phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076" } id: { type: "integer" format: "int64" description: "An id of an action" } inbound: { type: "boolean" description: "An action inbound" } labels: { type: "array" description: "Labels associated with an action" items: { type: "string" } } media: { type: "array" description: "~" items: { type: "object" description: "Represents a media file which can be added to a text message" properties: { accountId: { type: "integer" format: "int64" description: "~" } created: { type: "integer" format: "int64" description: "The time when the given resource was created, formatted in unix time milliseconds (read only). Example: 1473781817000 " } id: { type: "integer" format: "int64" description: "An id of a media file" } lengthInBytes: { type: "integer" format: "int64" description: "A size of a media file in bytes" } mediaType: { type: "string" description: "A MIME type of media file, ex: image/jpeg, image/png, video/mp4, audio/mp3, etc" } name: { type: "string" description: "A name of a media file" } publicUrl: { type: "string" description: "A public URL of a media file" } } } } message: { type: "string" description: "A text message" } modified: { type: "integer" format: "int64" description: "The time when the given resource was modified, formatted in unix time milliseconds (read only). Example: 1473781817000 for Sat, 05 Jan 1985 14:03:37 GMT" } records: { type: "array" description: "List of text records, each record contains additional details: time of sending, cost, current state. A single contact may have multiple numbers. If given text was sent as part of broadcast with configured retry logic then each text record will contain details about attempted number" items: { type: "object" description: "Represents a text message sent to a contact's number" properties: { billedAmount: { type: "number" format: "float" description: "A cost of a sent text" } callerName: { type: "string" description: "~" } finishTime: { type: "integer" format: "int64" description: "A time when the given resource was updated, formatted in unix time milliseconds (read only). Example: 1473781817000" } id: { type: "integer" format: "int64" description: "An id of a text record" } labels: { type: "array" description: "Labels associated with a text action" items: { type: "string" } } message: { type: "string" description: "A text message" } switchId: { type: "string" description: "~" } textResult: { type: "string" description: "Result of a text (SENT, RECEIVED, DNT, TOO_BIG, INTERNAL_ERROR, CARRIER_ERROR, CARRIER_TEMP_ERROR, UNDIALED). See [call states and results](https://developers.callfire.com/results-responses-errors.html)" enum: ["SENT", "RECEIVED", "DNT", "TOO_BIG", "INTERNAL_ERROR", "CARRIER_ERROR", "CARRIER_TEMP_ERROR", "UNDIALED", "INVALID_NUMBER"] } toNumber: { type: "string" description: "An attempted phone number" } } } } state: { type: "string" description: "Current state of an action (READY, SELECTED, CALLBACK, DISABLED, FINISHED, DNC, DUP, INVALID, TIMEOUT, PERIOD_LIMIT). See [call states and results](https://developers.callfire.com/results-responses-errors.html)" enum: ["READY", "SELECTED", "CALLBACK", "FINISHED", "DISABLED", "SKIPPED", "DNC", "DUP", "INVALID", "TIMEOUT", "PERIOD_LIMIT", "RESTRICTED_NUMBER"] } toNumber: { type: "string" description: "Recipient's phone number in E.164 format (11-digit) or short code. Example: 12132000384, 67076" } } } } } } }