---
# System prepended metadata

title: Apple sign in API Document
tags: [API Document]

---

# Apple sign in API Document
###### tags: `API Document`
{%hackmd theme-dark %}
### Flow: ![](https://i.imgur.com/Fz0u87U.jpg)



### API: 
## /v2/users/appleSignIn

Method = `POST`
Request header: `Application/json`
Request body:
```json=
{
    "authCode": ASAuthorizationAppleIDCredential.authorizationCode,
    "userId": ASAuthorizationAppleIDCredential.user,
    "firstName": ASAuthorizationAppleIDCredential.fullName.givenName,
    "lastName": ASAuthorizationAppleIDCredential.fullName.familyName,
    "email": ASAuthorizationAppleIDCredential.email
}
```
Note: ASAuthorizationAppleIDCredential's from iOS class

---

### Request:

| Name |  Type    | Description | Require |
| -------- | -------- | -------- | -------- |
| authCode | Text     | from apple server when user is successfully authenticated | Y |
| userId   | Text     | user's uniquely identify | Y |
| firstName| Text     | user's givenName | Y |
| lastName | Text     | user's familyName | Y |
| email    | Text     | user's email | Y |


### Response:

| Status  | Meaning         | 
| ------- | --------        |
| 200     | verify success  |
| 500     | verify fail     |


### Response Schema:
`status 200`
| Name |  Type    | Description | Require |
| -------- | -------- | -------- | -------- |
| message | Text   | return ok | Y |
| data   | Object  | include message(DB) and token(JWT) | Y |
| code| Number  | status code | Y |
| status | Text  |  | Y |


`status 500`
| Name |  Type    | Description | Require |
| -------- | -------- | -------- | -------- |
| message | Text   | return error message | Y |
| code| Number  | status code | Y |
| status | Text  |  | Y |