Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sie können eine bestimmte Domain oder alle Authentifizierungsdomains bestätigen, die Sie in Postmaster Tools registriert haben.
Bestätigen einer bestimmten Domain
Rufen Sie domains.get() mit dem Namen der Domain auf, um eine bestimmte Domain zu bestätigen. Im folgenden Codebeispiel sehen Sie, wie Sie eine bestimmte Domain bestätigen:
Java
/** * Gets a specific domain registered by the client. * * @param service Authorized Gmail PostmasterTools API instance. * @param domainName The fully qualified domain name. * @return The domain * @throws IOException */publicstaticDomaingetDomain(PostmasterToolsservice,StringdomainName)throwsIOException{Stringquery=String.format("domains/%s",domainName);Domaindomain=service.domains().get(query).execute();System.out.println(domain.toPrettyString());returndomain;}
Python
"""Gets a specific domain registered by the client.Args:service: Authorized Gmail PostmasterTools API instance.domain_name: The fully qualified domain name.Returns:The domain."""defget_domain(service,domain_name):try:query='domains/'+domain_namedomain=service.domains().get(name=query).execute();print(domain)returndomainexcepterrors.HttpErroraserr:print('An error occurred: %s'%err)
Alle Domains bestätigen
Rufen Sie domains.list() auf, um alle Domains zu bestätigen.
Im folgenden Codebeispiel sehen Sie, wie Sie alle Domains bestätigen:
Java
/** * Lists the domains that have been registered by the client. * * @param service Authorized Gmail PostmasterTools API instance. * @return Response message for ListDomains. * @throws IOException */publicstaticListDomainsResponselistDomains(PostmasterToolsservice)throwsIOException{ListDomainsResponselistDomainsResponse=service.domains().list().execute();for(Domaindomain:listDomainsResponse.getDomains()){System.out.println(domain.toPrettyString());}returnlistDomainsResponse;}
Python
"""Lists the domains that have been registered by the client.Args:service: Authorized Gmail PostmasterTools API instance.Returns:Response message for ListDomains."""deflist_domains(service):try:domains=service.domains().list().execute()ifnotdomains:print('No domains found.')else:print('Domains:')fordomainindomains['domains']:print(domain)returndomainsexcepterrors.HttpErroraserr:print('An error occurred: %s'%err)
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-29 (UTC)."],[],[],null,["# Verify authentication domain\n\nYou can verify a specific domain or all authentication domains you have\nregistered with Postmaster.\n\nVerify a specific domain\n------------------------\n\nTo verify a specific domain, call\n[`domains.get()`](/workspace/gmail/postmaster/reference/rest/v1/domains/get)\nwith the name of the domain. Following is a code sample showing how to verify a\nspecific domain: \n\n### Java\n\n /**\n * Gets a specific domain registered by the client.\n *\n * @param service Authorized Gmail PostmasterTools API instance.\n * @param domainName The fully qualified domain name.\n * @return The domain\n * @throws IOException\n */\n public static Domain getDomain(PostmasterTools service, String domainName) throws IOException {\n String query = String.format(\"domains/%s\", domainName);\n Domain domain = service.domains().get(query).execute();\n System.out.println(domain.toPrettyString());\n return domain;\n }\n\n### Python\n\n \"\"\"Gets a specific domain registered by the client.\n\n Args:\n service: Authorized Gmail PostmasterTools API instance.\n domain_name: The fully qualified domain name.\n\n Returns:\n The domain.\n \"\"\"\n def get_domain(service, domain_name):\n try:\n query = 'domains/' + domain_name\n domain = service.domains().get(name=query).execute();\n print(domain)\n return domain\n except errors.HttpError as err:\n print('An error occurred: %s' % err)\n\nVerify all domains\n------------------\n\nTo verify all domains, call\n[`domains.list()`](/workspace/gmail/postmaster/reference/rest/v1/domains/list).\nFollowing is a code sample showing how to verify all domains: \n\n### Java\n\n /**\n * Lists the domains that have been registered by the client.\n *\n * @param service Authorized Gmail PostmasterTools API instance.\n * @return Response message for ListDomains.\n * @throws IOException\n */\n public static ListDomainsResponse listDomains(PostmasterTools service) throws IOException {\n ListDomainsResponse listDomainsResponse = service.domains().list().execute();\n for (Domain domain : listDomainsResponse.getDomains()) {\n System.out.println(domain.toPrettyString());\n }\n return listDomainsResponse;\n }\n\n### Python\n\n \"\"\"Lists the domains that have been registered by the client.\n\n Args:\n service: Authorized Gmail PostmasterTools API instance.\n\n Returns:\n Response message for ListDomains.\n \"\"\"\n def list_domains(service):\n try:\n domains = service.domains().list().execute()\n if not domains:\n print('No domains found.')\n else:\n print('Domains:')\n for domain in domains['domains']:\n print(domain)\n return domains\n except errors.HttpError as err:\n print('An error occurred: %s' % err)"]]