Email and social profiles
This operation is documented in the sections below.
Email
sendEmailBindCode
Description
This operation is documented in the sections below.
Input
| Field | Type | Required | Description |
|---|---|---|---|
email | String! | ✓ | Email address. |
pin | String | - | Confirmation PIN code. |
Result
Response type - OperationResult.
Errors
UNAUTHENTICATED- the user is not authenticated.- $code - See the error reference for details.
- $code - See the error reference for details.
- $code - See the error reference for details.
Exchange example
{
"documentId": "sendEmailBindCode",
"variables": {
"pin": "1234"
}
}
{
"data": {
"sendEmailBindCode": {
"success": true
}
}
}
Related types
bindEmail
Description
This operation is documented in the sections below.
Input
| Field | Type | Required | Description |
|---|---|---|---|
email | String! | ✓ | Email address. |
code | String! | ✓ | Confirmation code |
Result
Response type - OperationResult.
Errors
UNAUTHENTICATED- the user is not authenticated.INVALID_CODE- the code is invalid or expired.- $code - See the error reference for details.
Exchange example
{
"documentId": "bindEmail",
"variables": {
"code": "123456"
}
}
{
"data": {
"bindEmail": {
"success": true
}
}
}
Related types
sendEmailConfirmCode
Description
This operation is documented in the sections below.
Input
The operation does not accept variables.
Result
Response type - OperationResult.
Errors
UNAUTHENTICATED- the user is not authenticated.- $code - See the error reference for details.
- $code - See the error reference for details.
Exchange example
{
"documentId": "sendEmailConfirmCode",
"variables": {}
}
{
"data": {
"sendEmailConfirmCode": {
"success": true
}
}
}
Related types
confirmEmail
Description
This operation is documented in the sections below.
Input
| Field | Type | Required | Description |
|---|---|---|---|
code | String! | ✓ | Confirmation code |
Result
Response type - OperationResult.
Errors
UNAUTHENTICATED- the user is not authenticated.INVALID_CODE- the code is invalid or expired.
Exchange example
{
"documentId": "confirmEmail",
"variables": {
"code": "123456"
}
}
{
"data": {
"confirmEmail": {
"success": true
}
}
}
Related types
Telegram and Social Accounts
Linking requires approval with the selected social network. Telegram uses the project's own bot.
socialBindUrl
Starts linking a social account, including Telegram. Open the returned url without changing its parameters. After approval, the browser returns to /cabinet/settings/social-confirmation?code=... on the project website.
Input
| Field | Type | Required | Description |
|---|---|---|---|
provider | String! | Yes | Enabled provider code, such as telegram or google |
pin | String | When configured | PIN for protected Telegram linking |
Result
SocialAuthUrl with url and provider.
Errors
UNAUTHENTICATED- sign in to the account.SOCIAL_PROVIDER_DISABLED- this sign-in method is unavailable.PIN_REQUIRED/INVALID_PIN- provide the current PIN.
Exchange Example
{
"documentId": "socialBindUrl",
"variables": {
"provider": "telegram",
"pin": "123456"
}
}
{
"data": {
"socialBindUrl": {
"url": "https://oauth.telegram.org/auth?client_id=123456789&redirect_uri=https%3A%2F%2Fapi.mmo-web.dev%2Fauth%2Fsocial%2Ftelegram%2Fcallback&response_type=code&scope=openid%20profile%20telegram%3Abot_access&state=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&nonce=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&code_challenge=ccccccccccccccccccccccccccccccccccccccccccc&code_challenge_method=S256",
"provider": "telegram"
}
}
}
confirmSocialBinding
Completes linking after returning from the social network. Send the received code with the same Bearer session used for socialBindUrl. The code expires after two minutes and can be used once. Read socialProfiles again after success.
Input
| Field | Type | Required | Description |
|---|---|---|---|
code | String! | Yes | 64-character code from the return URL |
Result
OperationResult with a localized message.
Errors
UNAUTHENTICATED- sign in to the account.SOCIAL_CALLBACK_FAILED- confirmation is invalid or expired; start linking again.SOCIAL_ALREADY_LINKED- the profile is already linked; unlink the previous connection first.SOCIAL_PROVIDER_DISABLED- this sign-in method has been disabled.
Exchange Example
{
"documentId": "confirmSocialBinding",
"variables": {
"code": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
}
}
{
"data": {
"confirmSocialBinding": {
"message": "Social account successfully linked"
}
}
}
unbindTelegram
Unlinks Telegram from the current account. Sign-in with that Telegram profile becomes unavailable until it is linked again.
Input
| Field | Type | Required | Description |
|---|---|---|---|
pin | String | When configured | PIN for protected Telegram unlinking |
Result
OperationResult with a localized message.
Errors
UNAUTHENTICATED- sign in to the account.NO_TELEGRAM- Telegram is not linked.PIN_REQUIRED/INVALID_PIN- provide the current PIN.
Exchange Example
{
"documentId": "unbindTelegram",
"variables": {
"pin": "123456"
}
}
{
"data": {
"unbindTelegram": {
"message": "Telegram successfully unlinked"
}
}
}
unbindSocial
Unlinks the selected social profile. For telegram, this has the same result as unbindTelegram.
Input
| Field | Type | Required | Description |
|---|---|---|---|
provider | String! | Yes | Provider code |
pin | String | When configured | PIN for protected Telegram unlinking |
Result
OperationResult with a localized message.
Errors
UNAUTHENTICATED- sign in to the account.SOCIAL_NOT_FOUND- the selected connection was not found.NO_TELEGRAM- Telegram is not linked.PIN_REQUIRED/INVALID_PIN- provide the current PIN.
Exchange Example
{
"documentId": "unbindSocial",
"variables": {
"provider": "google"
}
}
{
"data": {
"unbindSocial": {
"message": "Social account successfully unlinked"
}
}
}