Passer au contenu principal
GET
https://{tenantDomain}/api/v2
/
emails
/
provider
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Emails;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Emails.Provider.GetAsync(
            new GetEmailProviderRequestParameters {
                Fields = "fields",
                IncludeFields = true
            }
        );
    }

}
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    emails "github.com/auth0/go-auth0/management/management/emails"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &emails.GetEmailProviderRequestParameters{
        Fields: management.String(
            "fields",
        ),
        IncludeFields: management.Bool(
            true,
        ),
    }
    client.Emails.Provider.Get(
        context.TODO(),
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.emails.provider.requests.GetEmailProviderRequestParameters;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.emails().provider().get(
            GetEmailProviderRequestParameters
                .builder()
                .fields("fields")
                .includeFields(true)
                .build()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Emails\Provider\Requests\GetEmailProviderRequestParameters;

$client = new Management(
    token: '<token>',
);
$client->emails->provider->get(
    new GetEmailProviderRequestParameters([
        'fields' => 'fields',
        'includeFields' => true,
    ]),
);
from auth0.management import ManagementClient

client = ManagementClient(
    token="<token>",
)

client.emails.provider.get(
    fields="fields",
    include_fields=True,
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.emails.provider.get(
  fields: "fields",
  include_fields: true
)
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.emails.provider.get({
        fields: "fields",
        includeFields: true,
    });
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.emails.provider.get({
        fields: "fields",
        includeFields: true,
    });
}
main();
curl --request GET \
  --url https://{tenantDomain}/api/v2/emails/provider \
  --header 'Authorization: Bearer <token>'
{
  "name": "sendgrid",
  "enabled": true,
  "default_from_address": "<string>",
  "credentials": {
    "api_user": "<string>",
    "region": "<string>",
    "smtp_host": "<string>",
    "smtp_port": 123,
    "smtp_user": "<string>"
  },
  "settings": {}
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de requête

fields
string

Comma-separated list of fields to include or exclude (dependent upon include_fields) from the result. Leave empty to retrieve name and enabled. Additional fields available include credentials, default_from_address, and settings.

include_fields
boolean

Whether specified fields are to be included (true) or excluded (false).

Réponse

Email provider successfully retrieved.

name
string
défaut:sendgrid

Name of the email provider. Can be mailgun, mandrill, sendgrid, resend, ses, sparkpost, smtp, azure_cs, ms365, or custom.

enabled
boolean
défaut:true

Whether the provider is enabled (true) or disabled (false).

default_from_address
string

Email address to use as "from" when no other address specified.

credentials
object

Credentials required to use the provider.

settings
object

Specific provider setting