Skip to content

Commit 603ba2c

Browse files
Update README.md
1 parent 8451c11 commit 603ba2c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ client = contentstack.ContentstackClient()
2929
### Authentication
3030
To use this SDK, you need to authenticate your users by using the Authtoken, credentials, or Management Token (stack-level token).
3131
### Authtoken
32+
3233
An **Authtoken** is a read-write token used to make authorized CMA requests, and it is a **user-specific** token.
3334
```python
3435
client = contentstack.ContentstackClient(authtoken= 'authtoken')
@@ -42,6 +43,7 @@ client.login(email="email", password="password")
4243

4344
### Management Token
4445
**Management Tokens** are **stack-level** tokens, with no users attached to them.
46+
4547
```python
4648
result = client.stack(api_key = 'api_key', management_token= 'management_token' ).content_type('content_type_uid')
4749
.fetch().json()
@@ -50,6 +52,7 @@ print(result)
5052
### Contentstack Management Python SDK: 5-minute Quickstart
5153
#### Initializing Your SDK:
5254
To use the Python CMA SDK, you need to first initialize it. To do this, use the following code:
55+
5356
```python
5457
from contentstack_management import contentstack
5558

@@ -64,24 +67,25 @@ print(result)
6467

6568
#### Create Entry
6669
To create an entry in a specific content type of a stack, use the following lines of code:
70+
6771
```python
6872
entry = {
69-
title: 'Sample Entry',
70-
url: '/sampleEntry'
73+
title: 'Sample Entry',
74+
url: '/sampleEntry'
7175
}
7276

73-
result = client.stack(api_key= 'api_key').content_types('content_type_uid').entry().create(entry).json()
74-
print(result)
77+
result = client.stack(api_key= 'api_key').content_types('content_type_uid').entry().create(entry)
78+
print(result.json())
7579
```
7680

7781
#### Create Asset
7882
The following lines of code can be used to upload assets to your stack:
83+
7984
```python
8085
asset = {
81-
upload: 'path/to/file',
82-
title: 'Asset Title'
86+
upload: 'path/to/file',
87+
title: 'Asset Title'
8388
}
84-
8589
asset = client().stack(api_key='api_key').assets()
8690
result = asset.upload(asset)
8791
```
@@ -99,4 +103,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
99103

100104
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
101105

102-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
106+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)