Skip to content

Commit 4441994

Browse files
committed
Update Readme
1 parent 99a7bdf commit 4441994

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Get basic info on the authenticated user.
4444
from frameioclient import FrameioClient
4545

4646
client = FrameioClient("TOKEN")
47-
me = client.get_me()
47+
me = client.users.get_me()
4848
print(me['id'])
4949
```
5050

@@ -53,23 +53,29 @@ print(me['id'])
5353
Create a new asset and upload a file. For `parent_asset_id` you must have the root asset ID for the project, or an ID for a folder in the project. For more information on how assets work, check out [our docs](https://developer.frame.io/docs/workflows-assets/uploading-assets).
5454

5555
```python
56-
from frameioclient import FrameioClient
5756
import os
57+
from frameioclient import FrameioClient
5858

5959
client = FrameioClient("TOKEN")
6060

6161
filesize = os.path.getsize("sample.mp4")
6262

63-
# Create a new asset.
64-
asset = client.create_asset(
63+
# Create a new asset manually
64+
asset = client.assets.create(
6565
parent_asset_id="1234abcd",
6666
name="MyVideo.mp4",
6767
type="file",
6868
filetype="video/mp4",
6969
filesize=filesize
7070
)
7171

72-
# Upload the file at the target asset.
73-
file = open("sample.mp4", "rb")
74-
client.upload(asset, file)
72+
# Create a new folder
73+
client.assets.create(
74+
parent_asset_id="",
75+
name="Folder name",
76+
type="folder" # this kwarg is what makes it a folder
77+
)
78+
79+
# Upload a file
80+
client.assets.upload(asset, file)
7581
```

0 commit comments

Comments
 (0)