Skip to content

Commit 06e082f

Browse files
committed
Adds docs for rich content
1 parent 25c547d commit 06e082f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,30 @@ conv.destroy
123123

124124
```
125125

126+
#### Initiating a Rich Content Upload
127+
128+
```ruby
129+
conv = platform.conversations.find("conversation_id")
130+
content = conv.content.create(mime_type: "image/png", file: File.open("image.png"))
131+
# => #<Layer::Resources::RichContent @attributes={...}>
132+
133+
content.upload_url
134+
# => "https://www.googleapis.com/upload/storage/path/to/content"
135+
```
136+
137+
#### Refreshing the download URL for a Content Object
138+
139+
```ruby
140+
content = conv.content.find("content_id")
141+
# => #<Layer::Resources::RichContent @attributes={...}>
142+
143+
content.download_url
144+
# => "http://google-testbucket.storage.googleapis.com/some/download/path"
145+
146+
content.refresh_url
147+
"https://api.layer.com/apps/<APP_ID>/conversations/<CONVERSATION_ID>/content/<CONTENT_ID>"
148+
```
149+
126150
#### Sending Messages ####
127151

128152
```ruby

0 commit comments

Comments
 (0)