Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit 82471a6

Browse files
images readme documentation
1 parent 7ee58f5 commit 82471a6

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Python Client wrapper for [Typeform API](https://developer.typeform.com/)
1414
- [Forms](#forms)
1515
- [Responses](#responses)
1616
- [Themes](#themes)
17+
- [Images](#images)
1718
- [Tests](#tests)
1819

1920
## Installation
@@ -169,9 +170,35 @@ Retrieves a list of JSON descriptions for all themes in your Typeform account (p
169170

170171
```python
171172
themes = Typeform('<api_key>').themes
172-
result: dict = themes.list()
173+
result: dict = themes.get('abc123')
174+
```
175+
176+
### Images
177+
178+
#### `images.get(uid: str)`
179+
180+
Retrieves an image by the given id. [See docs](https://developer.typeform.com/create/reference/retrieve-image).
181+
182+
```python
183+
images = Typeform('<api_key>').images
184+
result: dict = images.get('abc123')
173185
```
174186

187+
#### `images.list()`
188+
189+
Retrieves a list of JSON descriptions for all images in your Typeform account. Images are listed in reverse-chronological order based on the date you added them to your account.
190+
191+
```python
192+
images = Typeform('<api_key>').images
193+
result: dict = images.list()
194+
```
195+
196+
#### `images.upload(file_name : str, image : str = None, url : str = None)`
197+
198+
Adds an image in your Typeform account.
199+
200+
Specify the URL of your image or send your image in base64 format, which encodes the image data as ASCII text. You can use a tool like Base64 Image Encoder to get the base64 code for the image you want to add.
201+
175202

176203
## Tests
177204

typeform/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def messages(self):
1313
return self.__messages
1414

1515
def get(self, uid: str) -> dict:
16-
"""Retrieves an image by the given form_id."""
16+
"""Retrieves an image by the given id."""
1717

1818
return self.__client.request('get', '/images/%s' % uid)
1919

0 commit comments

Comments
 (0)