How do I add a dns record through the cloudflare api?

I am writing a telegram bot in Python. The user enters the domain of the site, in the reply message I need to send him the dns record. How do I do this with the Cloudflare API?

Below should help a bit:

From the API reference:

Some other examples might help - I haven’t tested:

1 Like