---
title: "Access to data"
url: "https://developer-qual.migros.ch/apis/emarsys-facade-1/versions/c912724e-0d10-4f79-a473-ae6f75ea606a/operations/call"
---

> Full API specification: https://developer-qual.migros.ch/apis/emarsys-facade-1/versions/c912724e-0d10-4f79-a473-ae6f75ea606a.md

# Access to data

`POST` `/migros/marketing/campaigns/v1/emarsys/{domain}`

Operation ID: `call`

This endpoint implements the Emarsys protocol needed to personalize marketing emails. This endpoint is expected to change in incompatible ways until v1 is reached.

## Path parameters

- `domain` (string, required) - The domain to retrieve data from. For products you may query one product by its id. For coupons you may query one coupon by its id. TODO: probably will need "usercoupons": all coupons attributed to a cumulus nr. For discounts you may query one discount by its id.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Data of the domain selected by the POST body.
- `406` - The 406 response on any error. TODO
- `default` - Standard HTTP semantics. TODO: Needed if anything is 406 anyway?

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Emarsys Facade
  version: 1.0.0
servers:
  - description: URL of upstream
    url: https://api-qual.migros.ch
paths:
  /migros/marketing/campaigns/v1/emarsys/{domain}:
    post:
      description: >-
        This endpoint implements the Emarsys protocol needed to personalize
        marketing emails.


        This endpoint is expected to change in incompatible ways until v1 is
        reached.
      operationId: call
      parameters:
        - $ref: "#/components/parameters/domain"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmarsysRequest"
        description: Emarsys POST request body
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmarsysResponse"
          description: Data of the domain selected by the POST body.
        "406":
          content:
            text/plain:
              schema:
                type: string
          description: The 406 response on any error. TODO
        default:
          content:
            text/plain:
              schema:
                type: string
          description: "Standard HTTP semantics. TODO: Needed if anything is 406 anyway?"
      summary: Access to data
      tags:
        - Emarsys
security:
  - Kong-Api-Key: []
  - Basic-Auth: []
components:
  parameters:
    domain:
      description: >-
        The domain to retrieve data from.

        For products you may query one product by its id. For coupons you may
        query one coupon by its id. TODO: probably will need "usercoupons": all
        coupons attributed to a cumulus nr. For discounts you may query one
        discount by its id.
      example: products
      in: path
      name: domain
      required: true
      schema:
        enum:
          - products
          - coupons
          - discounts
        type: string
  schemas:
    EmarsysRequest:
      description: Emarsys request
      properties:
        fields:
          items:
            type: string
          type: array
        limit:
          maximum: 10
          minimum: 1
          type: integer
        parameters:
          items:
            additionalProperties:
              type: string
            type: object
          type: array
      required:
        - fields
        - parameters
    EmarsysResponse:
      description: Emarsys compatible response
      properties:
        content:
          items:
            additionalProperties:
              type: string
            type: object
          type: array
      required:
        - content
  securitySchemes:
    Kong-Api-Key:
      description: Kong key-auth authentication
      in: header
      name: X-Api-Key
      type: apiKey
    Basic-Auth:
      description: Kong basic-auth authentication
      scheme: basic
      type: http
```
