{"openapi":"3.0.1","info":{"title":"Message History API","description":"Provides methods for querying the message history for a given profile.\nReturns messages in descending chronological order from a specified date,\nallowing callers to page through the full history of messages sent to or\nfrom that profile across all channels.","version":"1.0.1"},"servers":[{"url":"https://{region}-api.dotdigital.com","variables":{"region":{"description":"The Dotdigital region id your account belongs to","enum":["r1","r2","r3"],"default":"r1"}}}],"security":[{"basicAuth":[]}],"paths":{"/cpaas/profiles/{profileId}/messages":{"get":{"summary":"Retrieves message history for the specified profile.  Messages retrieved from the date spacified (default now), in descending time order.","parameters":[{"name":"profileId","in":"path","description":"The id of the profile","required":true,"schema":{"type":"string"}},{"name":"channelId","in":"query","description":"The id of the channel the message was sent or received on","required":false,"schema":{"type":"string"}},{"name":"direction","in":"query","description":"The direction of the message","required":false,"schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"from","in":"query","description":"The date (in UTC, ISO 8601 format) to query backwards from","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","description":"Maximum number of results to return","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"List of messages matching the criteria","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MessageHistoryEntry"}}}}}}}}},"components":{"schemas":{"MessageHistoryEntry":{"required":["messageId"],"type":"object","properties":{"messageId":{"type":"string","description":"The unique id for the message."},"submittedOn":{"type":"string","description":"The date/time the message was submitted to the platform."},"profileId":{"type":"string","description":"The id of the profile that the message relates to"},"channelId":{"type":"string","description":"The id of the channel the message was sent/received on"},"direction":{"type":"string","description":"Indicates whether the message was outbound (from Comapi) or inbound (from the profile)","enum":["outbound","inbound"]},"status":{"type":"string","description":"The message status","enum":["processing","sent","delivered","read","failed"]},"message":{"$ref":"#/components/schemas/MessageHistoryEntry_message"}}},"MessageHistoryEntry_message":{"type":"object","properties":{"title":{"type":"string","description":"The message title (if appropriate / supported for the channel)"},"body":{"type":"string","description":"The message body"},"channelData":{"type":"object","properties":{},"description":"The channel specific data for the message"}},"description":"The message details."}},"parameters":{"profileIdPathParameter":{"name":"profileId","in":"path","description":"The id of the profile","required":true,"schema":{"type":"string"}},"fromQueryParameter":{"name":"from","in":"query","description":"The date (in UTC, ISO 8601 format) to query backwards from","required":false,"schema":{"type":"string","format":"date-time"}},"limitQueryParameter":{"name":"limit","in":"query","description":"Maximum number of results to return","required":false,"schema":{"type":"integer"}},"channelQueryParameter":{"name":"channelId","in":"query","description":"The id of the channel the message was sent or received on","required":false,"schema":{"type":"string"}},"directionQueryParameter":{"name":"direction","in":"query","description":"The direction of the message","required":false,"schema":{"type":"string","enum":["inbound","outbound"]}},"conversationQueryParameter":{"name":"conversationId","in":"query","description":"The id of the conversation the message was sent or received on","required":false,"schema":{"type":"string"}}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}}},"x-readme":{"samples-languages":["curl","csharp","java","node","php","python","ruby"],"explorer-enabled":true,"proxy-enabled":true,"samples-enabled":true}}