Skip to main content

Email and social profiles

This operation is documented in the sections below.

Email​

MutationdocumentId: sendEmailBindCodeauth: Bearer session

sendEmailBindCode​

Description​

This operation is documented in the sections below.

Input​

FieldTypeRequiredDescription
emailString!✓Email address.
pinString-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​

Request
documentId: sendEmailBindCode
{
"documentId": "sendEmailBindCode",
"variables": {
"email": "[email protected]",
"pin": "1234"
}
}
Response
200 OK
{
"data": {
"sendEmailBindCode": {
"success": true
}
}
}
MutationdocumentId: bindEmailauth: Bearer session

bindEmail​

Description​

This operation is documented in the sections below.

Input​

FieldTypeRequiredDescription
emailString!✓Email address.
codeString!✓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​

Request
documentId: bindEmail
{
"documentId": "bindEmail",
"variables": {
"email": "[email protected]",
"code": "123456"
}
}
Response
200 OK
{
"data": {
"bindEmail": {
"success": true
}
}
}
MutationdocumentId: sendEmailConfirmCodeauth: Bearer session

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​

Request
documentId: sendEmailConfirmCode
{
"documentId": "sendEmailConfirmCode",
"variables": {}
}
Response
200 OK
{
"data": {
"sendEmailConfirmCode": {
"success": true
}
}
}
MutationdocumentId: confirmEmailauth: Bearer session

confirmEmail​

Description​

This operation is documented in the sections below.

Input​

FieldTypeRequiredDescription
codeString!✓Confirmation code

Result​

Response type - OperationResult.

Errors​

  • UNAUTHENTICATED - the user is not authenticated.
  • INVALID_CODE - the code is invalid or expired.

Exchange example​

Request
documentId: confirmEmail
{
"documentId": "confirmEmail",
"variables": {
"code": "123456"
}
}
Response
200 OK
{
"data": {
"confirmEmail": {
"success": true
}
}
}

Telegram and Social Accounts​

Linking requires approval with the selected social network. Telegram uses the project's own bot.

MutationdocumentId: socialBindUrlauth: Bearer session

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​

FieldTypeRequiredDescription
providerString!YesEnabled provider code, such as telegram or google
pinStringWhen configuredPIN 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​

Request
documentId: socialBindUrl
{
"documentId": "socialBindUrl",
"variables": {
"provider": "telegram",
"pin": "123456"
}
}
Response
200 OK
{
"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"
}
}
}
MutationdocumentId: confirmSocialBindingauth: Bearer session

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​

FieldTypeRequiredDescription
codeString!Yes64-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​

Request
documentId: confirmSocialBinding
{
"documentId": "confirmSocialBinding",
"variables": {
"code": "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
}
}
Response
200 OK
{
"data": {
"confirmSocialBinding": {
"message": "Social account successfully linked"
}
}
}
MutationdocumentId: unbindTelegramauth: Bearer session

unbindTelegram​

Unlinks Telegram from the current account. Sign-in with that Telegram profile becomes unavailable until it is linked again.

Input​

FieldTypeRequiredDescription
pinStringWhen configuredPIN 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​

Request
documentId: unbindTelegram
{
"documentId": "unbindTelegram",
"variables": {
"pin": "123456"
}
}
Response
200 OK
{
"data": {
"unbindTelegram": {
"message": "Telegram successfully unlinked"
}
}
}
MutationdocumentId: unbindSocialauth: Bearer session

unbindSocial​

Unlinks the selected social profile. For telegram, this has the same result as unbindTelegram.

Input​

FieldTypeRequiredDescription
providerString!YesProvider code
pinStringWhen configuredPIN 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​

Request
documentId: unbindSocial
{
"documentId": "unbindSocial",
"variables": {
"provider": "google"
}
}
Response
200 OK
{
"data": {
"unbindSocial": {
"message": "Social account successfully unlinked"
}
}
}