diff --git a/src/content/docs/dns/dnssec/dnssec-active-migration.mdx b/src/content/docs/dns/dnssec/dnssec-active-migration.mdx index 9c1a5289c8a593b..d1f8adb7d760d52 100644 --- a/src/content/docs/dns/dnssec/dnssec-active-migration.mdx +++ b/src/content/docs/dns/dnssec/dnssec-active-migration.mdx @@ -60,23 +60,21 @@ The provider you are migrating from must allow you to add DNSKEY records on the You can do this [on the dashboard](/dns/manage-dns-records/how-to/create-dns-records/#create-dns-records) or through the [Create DNS Record endpoint](/api/resources/dns/subresources/records/methods/create/), as in the following example. -```bash -curl https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records \ ---header "X-Auth-Email: " \ ---header "X-Auth-Key: " \ ---header "Content-Type: application/json" \ ---data '{ - "type": "DNSKEY", - "name": "", - "data": { - "flags": 256, - "protocol": 3, - "algorithm": 13, - "public_key": "" - }, - "ttl":3600 - }' -``` +", + "data": { + "flags": 256, + "protocol": 3, + "algorithm": 13, + "public_key": "" + }, + "ttl": 3600 +}} +/> 2. Get Cloudflare's ZSK using either the API or a query from one of the assigned Cloudflare nameservers. diff --git a/src/content/docs/dns/dnssec/multi-signer-dnssec/setup.mdx b/src/content/docs/dns/dnssec/multi-signer-dnssec/setup.mdx index ab17588dc7c60c8..8c04b49ce2ce195 100644 --- a/src/content/docs/dns/dnssec/multi-signer-dnssec/setup.mdx +++ b/src/content/docs/dns/dnssec/multi-signer-dnssec/setup.mdx @@ -55,12 +55,10 @@ For the purpose of this tutorial, you will update your registrar with the DS rec 2. Add the ZSK(s) of your external provider(s) to Cloudflare by creating a DNSKEY record on your zone. -```bash -curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records" \ ---header "X-Auth-Email: " \ ---header "X-Auth-Key: " \ ---header "Content-Type: application/json" \ ---data '{ +", "data": { @@ -70,23 +68,21 @@ curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records" \ "public_key": "" }, "ttl": 3600 -}' -``` +}} +/> 3. Add your external provider(s) nameservers as NS records on your zone apex. -```bash -curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records" \ ---header "X-Auth-Email: " \ ---header "X-Auth-Key: " \ ---header "Content-Type: application/json" \ ---data '{ +", "content": "", "ttl": 86400 -}' -``` +}} +/> 4. Enable the usage of the nameservers you added in the previous step by using the API request below. diff --git a/src/content/docs/dns/manage-dns-records/reference/dns-record-types.mdx b/src/content/docs/dns/manage-dns-records/reference/dns-record-types.mdx index e76b23af4f89779..eba3f63336f225d 100644 --- a/src/content/docs/dns/manage-dns-records/reference/dns-record-types.mdx +++ b/src/content/docs/dns/manage-dns-records/reference/dns-record-types.mdx @@ -6,7 +6,7 @@ sidebar: --- -import { Details, Render } from "~/components" +import { Details, Render, APIRequest } from "~/components" This page provides information about some of the different types of DNS records that you can manage on Cloudflare. For guidance on how to add, edit, or delete DNS records, refer to [Manage DNS records](/dns/manage-dns-records/how-to/create-dns-records/). @@ -49,19 +49,20 @@ When creating A or AAAA records [using the API](/dns/manage-dns-records/how-to/c -```bash title="Request" {8,10} -curl "https://api.cloudflare.com/client/v4/zones//dns_records" \ ---header "X-Auth-Email: " \ ---header "X-Auth-Key: " \ ---header "Content-Type: application/json" \ ---data '{ - "type": "A", - "name": "www.example.com", - "content": "192.0.2.1", - "ttl": 3600, - "proxied": false -}' -``` + ```json title="Response" { @@ -119,23 +120,24 @@ Specific CNAME record values with traffic proxied through Cloudflare will enable When creating CNAME records [using the API](/dns/manage-dns-records/how-to/create-dns-records/#create-dns-records): * The `content` of the records is a [fully qualified domain name](https://en.wikipedia.org/wiki/Fully_qualified_domain_name). -* The `proxied` field affects the record's [proxy status](/dns/proxy-status/) +* The `proxied` field affects the record's [proxy status](/dns/proxy-status/). -```bash title="Request" {8,10} -curl "https://api.cloudflare.com/client/v4/zones//dns_records" \ ---header "X-Auth-Email: " \ ---header "X-Auth-Key: " \ ---header "Content-Type: application/json" \ ---data '{ - "type": "CNAME", - "name": "www.example.com", - "content": "www.another-example.com", - "ttl": 3600, - "proxied": false -}' -``` + ```json title="Response" { @@ -242,22 +244,20 @@ A [service record (SRV)](https://www.cloudflare.com/learning/dns/dns-records/dns -```bash title="Request" -curl "https://api.cloudflare.com/client/v4/zones//dns_records" \ ---header "X-Auth-Email: " \ ---header "X-Auth-Key: " \ ---header "Content-Type: application/json" \ ---data '{ - "type": "SRV", - "name": "_xmpp._tcp.example.com", - "data": { - "priority": 10, - "weight": 5, - "port": 5223, - "target": "server.example.com" - } -}' -``` + ```json title="Response" { diff --git a/src/content/docs/secrets-store/integrations/workers.mdx b/src/content/docs/secrets-store/integrations/workers.mdx index 9bf84dd16d7d04c..0e4dfb61fe3699a 100644 --- a/src/content/docs/secrets-store/integrations/workers.mdx +++ b/src/content/docs/secrets-store/integrations/workers.mdx @@ -6,7 +6,7 @@ sidebar: label: Use with Workers --- -import { WranglerConfig, Tabs, TabItem } from "~/components"; +import { WranglerConfig, Tabs, TabItem, APIRequest } from "~/components"; [Cloudflare Secrets Store](/secrets-store/) is a secure, centralized location in which account-level secrets are stored and managed. The secrets are securely encrypted and stored across all Cloudflare data centers. @@ -68,25 +68,24 @@ You can find and copy the store ID from the [Secrets Store tab](https://dash.clo Refer to [Secrets Store API](/api/resources/secrets_store/) for the full API documentation. -```bash -curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets \ ---header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ ---header "Content-Type: application/json" \ ---data '[ - { - "name":"", - "value":"", - "scopes":["workers"], - "comment":"" - }, - { - "name":"", - "value":"", - "scopes":["workers"], - "comment":"" - } -]' -``` +", + "value":"", + "scopes":["workers"], + "comment":"" + }, + { + "name":"", + "value":"", + "scopes":["workers"], + "comment":"" + } +]} +/> diff --git a/src/content/docs/secrets-store/manage-secrets/how-to.mdx b/src/content/docs/secrets-store/manage-secrets/how-to.mdx index 80e7d1de2abf2ea..a9def5404d02e44 100644 --- a/src/content/docs/secrets-store/manage-secrets/how-to.mdx +++ b/src/content/docs/secrets-store/manage-secrets/how-to.mdx @@ -5,7 +5,7 @@ sidebar: order: 2 --- -import { Tabs, TabItem } from "~/components"; +import { Tabs, TabItem, APIRequest } from "~/components"; Refer to the sections below to learn about common actions you might want to take when managing your data in Secrets Store. @@ -31,25 +31,24 @@ You must have a [Super Administrator or Secrets Store Admin role](/secrets-store A secret `name` cannot contain spaces. Refer to [Secrets Store API](/api/resources/secrets_store/) for the full API documentation. ::: -```bash -curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets \ ---header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ ---header "Content-Type: application/json" \ ---data '[ - { - "name":"", - "value":"", - "scopes":["workers"], - "comment":"" - }, - { - "name":"", - "value":"", - "scopes":["workers"], - "comment":"" - } -]' -``` +", + "value":"", + "scopes":["workers"], + "comment":"" + }, + { + "name":"", + "value":"", + "scopes":["workers"], + "comment":"" + } +]} +/> @@ -139,10 +138,9 @@ Before deleting a secret, make sure it is not deployed. Secrets Store secrets in Refer to [Secrets Store API](/api/resources/secrets_store/) for the full API documentation. -```bash -curl --request DELETE \ -https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/secrets_store/stores/$STORE_ID/secrets/$SECRET_ID \ ---header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" -``` + \ No newline at end of file diff --git a/src/content/partials/dns/add-mx-records.mdx b/src/content/partials/dns/add-mx-records.mdx index 8522a3bf57d1045..1b30364d38741df 100644 --- a/src/content/partials/dns/add-mx-records.mdx +++ b/src/content/partials/dns/add-mx-records.mdx @@ -1,8 +1,9 @@ --- {} - --- +import { APIRequest } from "~/components"; + ## Receive email If you only need to **receive** emails, Cloudflare offers [Email Routing](/email-routing/) for free email forwarding to custom email addresses. @@ -23,19 +24,17 @@ To **send and receive** emails from your domain, you need an SMTP provider. Then API example
- ```bash title="Request" - curl "https://api.cloudflare.com/client/v4/zones//dns_records" \ - --header "x-auth-email: " \ - --header "x-auth-key: " \ - --header "Content-Type: application/json" \ - --data '{ - "type":"A", - "name":"www.example.com", - "content":"192.0.2.1", - "ttl":3600, - "proxied":false - }' - ``` + ```json title="Response" { @@ -77,18 +76,16 @@ To **send and receive** emails from your domain, you need an SMTP provider. Then API example
- ```bash title="Request" - curl "https://api.cloudflare.com/client/v4/zones//dns_records" \ - --header "x-auth-email: " \ - --header "x-auth-key: " \ - --header "Content-Type: application/json" \ - --data '{ - "type":"MX", - "name":"example.com", - "content":"mail.example.com", - "ttl":3600 - }' - ``` + ```json title="Response" {