Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit c4f9107

Browse files
mattjanssennijel
authored andcommitted
Enhance API Token documentation
1 parent 9f28c65 commit c4f9107

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ if __name__ == '__main__':
172172

173173
When you create a **CloudFlare** class you can pass up to four parameters.
174174

175-
* Account email
176-
* Account API key
175+
* API Token or API Key
176+
* Account email (only if an API Key is being used)
177177
* Optional Origin-CA Certificate Token
178178
* Optional Debug flag (True/False)
179179

@@ -186,10 +186,13 @@ import CloudFlare
186186
# A minimal call with debug enabled
187187
cf = CloudFlare.CloudFlare(debug=True))
188188

189-
# A full blown call with passed basic account information
189+
# An authenticated call using an API Token (note the missing email)
190+
cf = CloudFlare.CloudFlare(token='00000000000000000000000000000000')
191+
192+
# An authenticated call using an API Key
190193
cf = CloudFlare.CloudFlare(email='user@example.com', token='00000000000000000000000000000000')
191194

192-
# A full blown call with passed basic account information and CA-Origin info
195+
# An authenticated call using an API Key and CA-Origin info
193196
cf = CloudFlare.CloudFlare(email='user@example.com', token='00000000000000000000000000000000', certtoken='v1.0-...')
194197
```
195198

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ Providing Cloudflare Username and API Key
196196
When you create a **CloudFlare** class you can pass up to four
197197
parameters.
198198

199-
- Account email
200-
- Account API key
199+
- API Token or API Key
200+
- Account email (only if an API Key is being used)
201201
- Optional Origin-CA Certificate Token
202202
- Optional Debug flag (True/False)
203203

@@ -211,13 +211,13 @@ parameters.
211211
# A minimal call with debug enabled
212212
cf = CloudFlare.CloudFlare(debug=True))
213213
214-
# Using API Token (note missing email)
214+
# An authenticated call using an API Token (note the missing email)
215215
cf = CloudFlare.CloudFlare(token='00000000000000000000000000000000')
216216
217-
# A full blown call with passed basic account information
217+
# An authenticated call using an API Key
218218
cf = CloudFlare.CloudFlare(email='user@example.com', token='00000000000000000000000000000000')
219219
220-
# A full blown call with passed basic account information and CA-Origin info
220+
# An authenticated call using an API Key and CA-Origin info
221221
cf = CloudFlare.CloudFlare(email='user@example.com', token='00000000000000000000000000000000', certtoken='v1.0-...')
222222
223223
If the account email and API key are not passed when you create the

0 commit comments

Comments
 (0)