-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start adding API examples for different rest api and upload api endpo…
…ints (#170) * Start adding API examples for different rest api and upload api endpoints * Change path to api_examples. Ignore the directory on String literal comment requirements from rubocop * Fix remaining rubocop violations on all the examples
- Loading branch information
1 parent
f5a6bc7
commit e0e6772
Showing
43 changed files
with
291 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuids = %w[21975c81-7f57-4c7a-aef9-acfe28779f78 cbaf2d73-5169-4b2b-a543-496cf2813dff] | ||
puts Uploadcare::FileList.batch_delete(uuids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
puts Uploadcare::FileMetadata.delete('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
puts Uploadcare::File.delete('1bac376c-aa7e-4356-861b-dd2657b5bfd2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
puts Uploadcare::Group.delete('c5bec8c7-d4b6-4921-9e55-6edb027546bc~1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
puts Uploadcare::Webhook.delete('https://yourwebhook.com') |
7 changes: 7 additions & 0 deletions
7
api_examples/rest_api/get_addons_aws_rekognition_detect_labels_execute_status.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
request_id = 'd1fb31c6-ed34-4e21-bdc3-4f1485f58e21' | ||
result = Uploadcare::Addons.ws_rekognition_detect_labels_status(request_id) | ||
puts result.status |
7 changes: 7 additions & 0 deletions
7
api_examples/rest_api/get_addons_aws_rekognition_detect_moderation_labels_execute_status.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
request_id = 'd1fb31c6-ed34-4e21-bdc3-4f1485f58e21' | ||
result = Uploadcare::Addons.ws_rekognition_detect_moderation_labels_status(request_id) | ||
puts result.status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
request_id = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
result = Uploadcare::Addons.remove_bg_status(request_id) | ||
puts result.status |
7 changes: 7 additions & 0 deletions
7
api_examples/rest_api/get_addons_uc_clamav_virus_scan_execute_status.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
request_id = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
result = Uploadcare::Addons.uc_clamav_virus_scan_status(request_id) | ||
puts result.status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
token = 32_921_143 | ||
puts Uploadcare::DocumentConverter.status(token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '740e1b8c-1ad8-4324-b7ec-112c79d8eac2' | ||
puts Uploadcare::DocumentConverter.info(uuid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
token = 1_201_016_744 | ||
puts Uploadcare::VideoConverter.status(token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
list = Uploadcare::FileList.file_list(stored: true, removed: false, limit: 100) | ||
list.each { |file| puts file.inspect } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
puts Uploadcare::File.info(uuid).inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
puts Uploadcare::FileMetadata.show(uuid, 'pet') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
puts Uploadcare::FileMetadata.index(uuid).inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
groups = Uploadcare::GroupList.list(limit: 10) | ||
groups.each { |group| puts group.inspect } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = 'c5bec8c7-d4b6-4921-9e55-6edb027546bc~1' | ||
puts Uploadcare::Group.info(uuid).inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
project_info = Uploadcare::Project.show | ||
puts project_info.inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
webhooks = Uploadcare::Webhook.list | ||
webhooks.each { |webhook| puts webhook.inspect } |
6 changes: 6 additions & 0 deletions
6
api_examples/rest_api/post_addons_aws_rekognition_detect_labels_execute.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
Uploadcare::Addons.ws_rekognition_detect_labels(uuid) |
6 changes: 6 additions & 0 deletions
6
api_examples/rest_api/post_addons_aws_rekognition_detect_moderation_labels_execute.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
Uploadcare::Addons.ws_rekognition_detect_moderation_labels(uuid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
Uploadcare::Addons.remove_bg(uuid, crop: true) |
6 changes: 6 additions & 0 deletions
6
api_examples/rest_api/post_addons_uc_clamav_virus_scan_execute.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
Uploadcare::Addons.uc_clamav_virus_scan(uuid, purge_infected: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
document_params = { uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2', format: :pdf } | ||
options = { store: true } | ||
Uploadcare::DocumentConverter.convert(document_params, options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
video_params = { | ||
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2', | ||
format: :mp4, | ||
quality: :lighter | ||
} | ||
options = { store: true } | ||
Uploadcare::VideoConverter.convert(video_params, options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
copied_file = Uploadcare::File.local_copy(source, store: true) | ||
puts copied_file.uuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
target = 'custom_storage_connected_to_the_project' | ||
copied_file = Uploadcare::File.remote_copy(source, target, make_public: true) | ||
puts copied_file.uuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
options = { | ||
target_url: 'https://yourwebhook.com', | ||
event: 'file.uploaded', | ||
is_active: true | ||
} | ||
Uploadcare::Webhook.create(**options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuids = %w[ | ||
b7a301d1-1bd0-473d-8d32-708dd55addc0 | ||
1bac376c-aa7e-4356-861b-dd2657b5bfd2 | ||
] | ||
Uploadcare::FileList.batch_store(uuids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
key = 'pet' | ||
value = 'dog' | ||
Uploadcare::FileMetadata.update(uuid, key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2' | ||
Uploadcare::File.store(uuid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
webhook_id = 1_473_151 | ||
options = { | ||
target_url: 'https://yourwebhook.com', | ||
event: 'file.uploaded', | ||
is_active: true, | ||
signing_secret: 'webhook-secret' | ||
} | ||
Uploadcare::Webhook.update(webhook_id, options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
token = '945ebb27-1fd6-46c6-a859-b9893712d650' | ||
puts Uploadcare::Uploader.get_upload_from_url_status(token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '0d712319-b970-4602-850c-bae1ced521a6~1' | ||
info = Uploadcare::Group.info(uuid) | ||
puts info.inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuid = '740e1b8c-1ad8-4324-b7ec-112c79d8eac2' | ||
info = Uploadcare::File.info(uuid) | ||
puts info.inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source_file = File.open('image.png') | ||
Uploadcare::Uploader.upload(source_file, store: 'auto') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source_url = 'https://source.unsplash.com/featured' | ||
Uploadcare::Uploader.upload(source_url, store: 'auto') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
uuids = [ | ||
'd6d34fa9-addd-472c-868d-2e5c105f9fcd', | ||
'b1026315-8116-4632-8364-607e64fca723/-/resize/x800/' | ||
] | ||
Uploadcare::Group.create(uuids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Uploadcare lib provides high level API for multipart uploads that does everything for you | ||
|
||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source_file = File.open('image.png') | ||
Uploadcare::Uploader.upload(source_file, store: 'auto') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Uploadcare lib provides high level API for multipart uploads that does everything for you | ||
|
||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source_file = File.open('image.png') | ||
Uploadcare::Uploader.upload(source_file, store: 'auto') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Uploadcare lib provides high level API for multipart uploads that does everything for you | ||
|
||
require 'uploadcare' | ||
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY' | ||
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY' | ||
|
||
source_file = File.open('image.png') | ||
Uploadcare::Uploader.upload(source_file, store: 'auto') |