Get the OAuth2 provider consent URL for a mail account

POST /api-v1/mail-server/oauth2/consent-url

Headers

  • WEAL-TOKEN string Required

    API token (can be retrieved from account settings)

  • TARGET-ORGANIZATION-ID integer

    ID of organization, for which the operation must be performed

application/json

Body Required

  • mailServerConfigId integer Required
  • provider string Required

    Values are GOOGLE, MICROSOFT, or YAHOO.

  • clientId string Required
  • clientSecret string Required
  • redirectUri string Required

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • consentUrl string
    • state string
  • 400

    400 Bad Request

  • 401

    401 Unauthorized

  • 403

    403 Access Denied

  • 404

    404 Not Found

  • 500

    500 Internal Server Error

POST /api-v1/mail-server/oauth2/consent-url
curl \
 --request POST 'https://wyzio.app/api-v1/mail-server/oauth2/consent-url' \
 --header "Content-Type: application/json" \
 --header "WEAL-TOKEN: string" \
 --header "TARGET-ORGANIZATION-ID: 42" \
 --data '{"mailServerConfigId":42,"provider":"GOOGLE","clientId":"string","clientSecret":"string","redirectUri":"string"}'
Request examples
# Headers
WEAL-TOKEN: string
TARGET-ORGANIZATION-ID: 42

# Payload
{
  "mailServerConfigId": 42,
  "provider": "GOOGLE",
  "clientId": "string",
  "clientSecret": "string",
  "redirectUri": "string"
}
Response examples (200)
{
  "consentUrl": "string",
  "state": "string"
}