# Authenticate with Sign in with Apple

- Operation ID: `AuthenticateWithApple`
- HTTP method: `POST`
- Path: `/sauth/auth/login/client/apple`
- [Human-readable API reference](https://hub.synerise.com/api-reference/authorization#tag/Authorization-(deprecated)/operation/AuthenticateWithApple)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /sauth/auth/login/client/apple:
    post:
      tags:
        - Authorization (deprecated)
      summary: Authenticate with Sign in with Apple
      description: |
        Obtain a new JWT token by using Sign in with Apple authentication token.

        ---

        **Authentication:** Not required
      operationId: AuthenticateWithApple
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                accessToken:
                  type: string
                  description: Apple token
                apiKey:
                  type: string
                  description: Profile (formerly "Client") API key
                uuid:
                  type: string
                  description: UUID of the Profile
                  example: 07243772-008a-42e1-ba37-c3807cebde8f
                deviceId:
                  type: string
                  description: |
                    Unique Android or iOS device ID.

                    We recommend sending this attribute every time, to assign a web push registration to the device.

                    Required when any form of [unknown device control](https://hub.synerise.com/docs/settings/tool/iam-for-apps/access/#unknown-device-control) is enabled.
                agreements:
                  description: |-
                    Marketing agreements of the Profile.

                    You can also pass the values as strings (`"true"`;`"TRUE"`;`"True"`/`"false"`;`"FALSE"`;`"False"`) or integers (`1` for true and `0` for false).
                  type: object
                  properties:
                    email:
                      type: boolean
                      description: Permission to receive marketing information by email
                      default: true
                    sms:
                      type: boolean
                      description: Permission to receive marketing information by SMS
                      default: true
                    push:
                      type: boolean
                      description: Permission to receive push notifications
                      default: true
                    bluetooth:
                      type: boolean
                      deprecated: true
                      description: This field is ignored.
                      default: false
                    rfid:
                      type: boolean
                      deprecated: true
                      description: This field is ignored.
                      default: false
                    wifi:
                      type: boolean
                      deprecated: true
                      description: This field is ignored.
                      default: false
                    whatsApp:
                      type: boolean
                      description: Permission to receive WhatsApp messages
                      default: false
                  example:
                    email: true
                    sms: true
                    push: true
                    bluetooth: false
                    rfid: false
                    wifi: false
                attributes:
                  type: object
                  description: |
                    Custom attributes (with any names)

                    <strong><span style="color:red">WARNING<span></strong>: Some attributes cannot be sent in this object and will be ignored. Some of these are reserved for system use, and others must be sent as properties of the profile in the root object of the request body instead of inside the `attributes` object.

                    <details><summary><span style="background:red;color:white">Click to expand the list of reserved attributes</span></summary>
                    <code>email</code><br><code>id</code><br><code>clientId</code><br><code>phone</code><br><code>customId</code><br><code>uuid</code><br><code>firstName</code><br><code>lastName</code><br>
                    <code>displayName</code><br><code>company</code><br><code>address</code><br><code>city</code><br><code>province</code><br><code>zipCode</code><br><code>countryCode</code><br>
                    <code>birthDate</code><br><code>sex</code><br><code>avatarUrl</code><br><code>anonymous</code><br><code>agreements</code><br><code>tags</code><br><code>businessProfileId</code><br>
                    <code>time</code><br><code>ip</code><br><code>source</code><br><code>newsletter_agreement</code><br><code>custom_identify</code><br><code>firstname</code><br>
                    <code>lastname</code><br><code>created</code><br><code>updated</code><br><code>last_activity_date</code><br><code>birthdate</code><br><code>external_avatar_url</code><br>
                    <code>displayname</code><br><code>receive_smses</code><br><code>receive_push_messages</code><br><code>receive_webpush_messages</code><br>
                    <code>receive_btooth_messages</code><br><code>receive_rfid_messages</code><br><code>receive_wifi_messages</code><br><code>receive_whatsapp_messages</code><br><code>whatsapp_id</code><br>
                    <code>zipCode</code><br><code>anonymous_type</code><br><code>country_id</code><br><code>geo_loc_country</code><br><code>geo_loc_isp</code><br>
                    <code>geo_loc_lat</code><br><code>geo_loc_lon</code><br><code>club_card_id</code><br><code>type</code><br><code>confirmed</code><br><code>facebookId</code><br><code>deletedAt</code><br><code>deleted_unique</code><br><code>status</code><br><code>recognized</code><br><code>previous_clients</code><br><code>testProfile</code><br>
                    <code>apikey</code><br><code>apiKey</code><br><code>ApiKey</code><br><code>Apikey</code><br><code>tracker</code><br><code>snr_sdk_version</code><br>
                    <code>eventCreateTime</code><br><code>correlationId</code>
                    </details>
                  additionalProperties:
                    description: Can be numbers, strings, or booleans.
                tags:
                  type: array
                  description: Tags can be used to group Profile accounts.
                  items:
                    type: string
            example: '{"accessToken":"EAAfsMmaWLW0BAOZAqSoh8ZB5y2ZAixtSrlvvq3fpWGlcrfcoWOiAwBCZBpBDlzwHFSZB58nUBjOz2UMuopO7p2Q65QU1ZAiB2XaxRzje0bBd7Tu87f6C2pcoZAP65agWAF0ElZCNyKn4iAtFd9RhppkwU9ll0AokBZBnDroZCIaxE3IHSWGtE567AUrXkZAsQEjYsZAZAcYx0ki1w7XUToy9Wps9NA0OuBdMhruB3htuiukwOFAZDZD","apiKey":"5AEAA3D5-E147-C7EB-invalid","uuid":"91b8e035-dca3-4805-8915-2cfb01d31fde","deviceId":"deviceId","agreements":{"email":true,"sms":true,"push":true,"bluetooth":true,"rfid":true,"wifi":true},"attributes":{"property1":"string","property2":"string"}}'
        required: true
      responses:
        "200":
          description: Profile authorization token
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: "[JWT](https://jwt.io/) token"
      deprecated: true
      x-snr-doc-urls:
        - /api-reference/authorization#tag/Authorization-(deprecated)/operation/AuthenticateWithApple
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/sauth/auth/login/client/apple \
              --header 'content-type: application/json' \
              --data '{"accessToken":"string","apiKey":"string","uuid":"07243772-008a-42e1-ba37-c3807cebde8f","deviceId":"string","agreements":{"email":true,"sms":true,"push":true,"bluetooth":false,"rfid":false,"wifi":false},"attributes":{"property1":null,"property2":null},"tags":["string"]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"accessToken\":\"string\",\"apiKey\":\"string\",\"uuid\":\"07243772-008a-42e1-ba37-c3807cebde8f\",\"deviceId\":\"string\",\"agreements\":{\"email\":true,\"sms\":true,\"push\":true,\"bluetooth\":false,\"rfid\":false,\"wifi\":false},\"attributes\":{\"property1\":null,\"property2\":null},\"tags\":[\"string\"]}"

            headers = { 'content-type': "application/json" }

            conn.request("POST", "/sauth/auth/login/client/apple", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "accessToken": "string",
              "apiKey": "string",
              "uuid": "07243772-008a-42e1-ba37-c3807cebde8f",
              "deviceId": "string",
              "agreements": {
                "email": true,
                "sms": true,
                "push": true,
                "bluetooth": false,
                "rfid": false,
                "wifi": false
              },
              "attributes": {
                "property1": null,
                "property2": null
              },
              "tags": [
                "string"
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/sauth/auth/login/client/apple");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/sauth/auth/login/client/apple",
              "headers": {
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              accessToken: 'string',
              apiKey: 'string',
              uuid: '07243772-008a-42e1-ba37-c3807cebde8f',
              deviceId: 'string',
              agreements: {email: true, sms: true, push: true, bluetooth: false, rfid: false, wifi: false},
              attributes: {property1: null, property2: null},
              tags: ['string']
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/sauth/auth/login/client/apple');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"accessToken":"string","apiKey":"string","uuid":"07243772-008a-42e1-ba37-c3807cebde8f","deviceId":"string","agreements":{"email":true,"sms":true,"push":true,"bluetooth":false,"rfid":false,"wifi":false},"attributes":{"property1":null,"property2":null},"tags":["string"]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/sauth/auth/login/client/apple")
              .header("content-type", "application/json")
              .body("{\"accessToken\":\"string\",\"apiKey\":\"string\",\"uuid\":\"07243772-008a-42e1-ba37-c3807cebde8f\",\"deviceId\":\"string\",\"agreements\":{\"email\":true,\"sms\":true,\"push\":true,\"bluetooth\":false,\"rfid\":false,\"wifi\":false},\"attributes\":{\"property1\":null,\"property2\":null},\"tags\":[\"string\"]}")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Authorization (deprecated)
```
