# Messages List

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/messages_history:
    get:
      summary: Messages List
      deprecated: true
      description: >-
        ## Deprecation notice


        This endpoint has been deprecated, please use [v2
        version](https://docs.mpc.placewise.com/api-3806267).


        Returns messages (SMS, Email and Push) sent within Loyalty Club.


        ## Query Parameters


        | Parameter | Type          | Required? | Default |
        Description                                                                         
        |

        |-----------|---------------|-----------|---------|--------------------------------------------------------------------------------------|

        | per_page  | integer       | no        | 100     | Number of results to
        be returned per request (100 is the maximum)                    |

        | page_no   | integer       | no        | 1       | Number of results
        page                                                               |

        | type     | String[] | no        | null    | Message types that should
        be returned - available values: `["sms", "email", "push"]` |

        | member_id | integer       | no        | null    | When present, ony
        messages sent to this member will be returned                      |


        ### Message model


        Key                 | Message type |
        Description                                                  | Required?
        | Type

        ---------------------|--------------|--------------------------------------------------------------|-----------|----------------------------------

        id                  | all          | Message
        ID                                                   | yes       |
        String

        type                | all         
        |                                                              |
        yes       | Enum: `["sms", "email", "push"]`

        created_at          | all          | Time when the message has been
        sent                          | yes       | ISO 8601 DateTime

        content             | all          | Message content. Note: HTML is
        stripped from Email messages. | yes       | String

        subject             | email, push  | Email & push
        subject/title                                   | no        | String

        sender              | sms          | SMS sender (may be string or
        MSISDN)                         | no        | String

        msisdn              | sms          | MSISDN the message has been sent
        to                          | no        | String

        from_name           | email        | Email sender
        name                                            | no        | String

        from_address        | email        | Email sender
        address                                         | no        | String

        email               | email        | Address the message has been sent
        to                         | no        | String

        url                 | push         | A link contained by the Push
        message                         | no        | String

        image               | push         | An image contained by the Push
        message                       | no        | String

        data                | push         | Additional data contained by the
        Push message                | no        | Object

        app_token           | push         | App token the message has been sent
        to                       | no        | String

        message_id          | all          | ID of Message in MPC
        Gateways                                | yes       | Integer

        sending_id          | all          | ID of MPC
        Sending                                            | no        | String

        campaign_id         | all          | ID of MPC Sending
        Campaign                                   | no        | String

        loyalty_club_id     | all         
        |                                                              |
        yes       | Integer

        customer_id         | all         
        |                                                              |
        yes       | Integer

        member_id           | all         
        |                                                              |
        no        | Integer

        transmitted_at      | all          | Time when the message has been sent
        to 3rd party gateway     | no        | ISO 8601 DateTime

        service_type        | all          |
        [Service](doc-341736#service)                        | no        |
        String

        transmission_status | all         
        |                                                              |
        yes       | String

        delivery_status     | all         
        |                                                              |
        yes       | String

        tags                | all          | List of merge-tags supplied for the
        Message                  | no        | Object[]

        external_id         | all          | ID of Message in 3rd party
        system                            | no        | String

        external_error      | all         
        |                                                              |
        no        | Object

        gateway             | all          | 3rd party name (e.g. `ses`,
        `firebase`)                      | no        | Object


        ## Example


        ```shell

        curl -X GET
        'https://api.mpc.placewise.com/v1/messages_history?type=push&member_id=381093'
        \
            -H 'X-Client-Authorization: B7t9U9tsoWsGhrv2ouUoSqpM' \
            -H 'X-Product-Name: default' \
            -H 'X-User-Agent:  CURL manual test' \
            -H 'X-Loyalty-Club-Slug: infinity-mall'
        ```


        When successful, returns object containing
        [message](api-3511020#message-model)s sent to member and
        [PaginationInfo](doc-341638)


        ```json

        {
          "messages": [
            {
              "id": "ZW1haWw6NjY5MzM=",
              "created_at": "2022-03-04T09:15:52.062Z",
              "type": "email",
              "content": "[Logo]\n\nHi Piotr!\n\n[Placewise](https://shortener.dev.boostcom.no/y8n/ZQGeE2)",
              "subject": "Hello Piotr",
              "from_name": "MPC",
              "from_address": "dev@mpc.placewise.com",
              "email": "member@placewise.com",
              "message_id": 7038,
              "sending_id": "5350",
              "campaign_id": 421,
              "loyalty_club_id": 1174,
              "member_id": 48076883,
              "transmitted_at": "2022-03-04T09:15:53.474Z",
              "service_type": "campaigns",
              "transmission_status": "transmitted",
              "delivery_status": "sent",
              "tags": [
                { "tag": "link", "link": "https://www.placewise.com", "value": "https://shortener.dev.boostcom.no/y8n/ZQGeE2" },
                { "tag": "first_name", "value": "Piotr" }
              ],
              "external_error": { "code": 52 },
              "external_id": "e36ca3fe9778c25ea70b078978bd6087",
              "gateway": "ses"
            }
          ],
          "pagination_info": {} // Pagination info - see 'Pagination info"
        }


        ```
      tags:
        - API Reference/Management API/Messaging History
      parameters:
        - name: member_id
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: ''
          required: false
          schema:
            type: string
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: API Reference/Management API/Messaging History
      x-apidog-status: deprecated
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3511383-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```