Skip to content
Navigation

Connect the email assistant with an email code

POST
https://api.nicer.travel/agent/email-connection

Connects the caller's email to the email assistant, reports whether it is connected, or disconnects it, by action: status answers whether it is connected; start checks the captcha token and emails the caller a six-digit code, answering a session; finish takes that session and the code and, when they match the caller's account, keeps a sign-in for the email assistant on the server; disconnect ends it. The sign-in it keeps is encrypted on the server and never sent back. Any signed-in person with an email on their account may call it, for their own email only. Errors: 400 ERROR_EMAIL_REQUIRED for an account without an email; 403 ERROR_UNAUTHORIZED for a captcha that fails or a code of another account; 400 ERROR_INVALID_CODE for a code that expired.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Request body JSON required

One of the following:

  • object
    • action
      string
      required
  • object
    • action
      string
      required
    • captchaToken
      string
      required
      maxLength: 2048 · minLength: 1
  • object
    • action
      string
      required
    • session
      string
      required
      maxLength: 4096 · minLength: 1
    • code
      string
      required
      pattern: ^\d{6}$
  • object
    • action
      string
      required

Returns

200

OK

JSON
  • connected
    boolean
    required
  • email
    required

    Any of the following:

    • string
    • null
  • session
    optional
    string

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close