Getting Started & Installation
Installation
$ nuget install SkylabStudio
npm install skylab-studio
$ $ pip install skylab_studio
gem install skylab_studio
# or with Bundler
gem 'skylab_studio'
bundle install
Example Usage
using Skylabstudio;
var apiClient = new StudioClient("YOUR_SKYLAB_API_TOKEN");
import skylabStudio from "skylab-studio";
const api = skylabStudio("your-api-key");
import skylab_studio
api = skylab_studio.api(api_key='YOUR-API-KEY')
require 'rubygems'
require 'skylab_studio'
client = SkylabStudio::Client.new(api_key: 'YOUR API KEY', debug: true)
// Example Job Processing Flow with Callback
// CREATE PROFILE
dynamic profile = await apiClient.CreateProfile(new { name = $"Test Profile", enable_crop = false, enable_color = true });
// CREATE JOB
var jobName = $"test-job";
dynamic job = await apiClient.CreateJob(new { name = jobName, profile_id = profile.id.Value });
// UPLOAD PHOTO
string filePath = "/path/to/photo";
dynamic res = await apiClient.UploadPhoto(filePath, "job", job.id.Value);
// QUEUE JOB
dynamic queuedJob = await apiClient.QueueJob(job.id.Value, new { callback_url = "YOUR_CALLBACK_ENDPOINT" });
// NOTE: Once the job is queued, it will get processed then complete
// We will send a response to the specified callback_url with the output photo download urls
// CREATE PROFILE
const profilePayload = {
"name": "profile name",
"enable_crop": false,
"enable_retouch": true
}
const profile = await api.createProfile(profilePayload)
// CREATE JOB
const jobPayload = {
"name": "job name",
"profile_id": profile.id
}
const job = await api.createJob(jobPayload)
// UPLOAD JOB PHOTO(S)
const filePath = "/path/to/photo"
await api.uploadJobPhoto(filePath, job.id)
// QUEUE JOB
payload = { "callback_url" = "YOUR_CALLBACK_ENDPOINT" }
await api.queueJob(job.id, payload)
// NOTE: Once the job is queued, it will get processed then completed
// We will send a response to the specified callback_url with the output photo download urls
// After job has been completed, either download manually or download 1 photo:
await api.downloadPhoto(photoId, 'path/to/output/directory')
// or download all photos for a job:
await api.downloadPhotos(jobId, 'path/to/output/directory')
# CREATE PROFILE
payload = {
"name": "profile name",
}
api.create_profile(payload=payload)
# CREATE JOB
payload={
"name": "job name",
"profile_id": profile_id
}
job = api.create_job(payload)
# UPLOAD PHOTO
filePath = "/path/to/photo"
api.upload_job_photo(filePath, job.id)
# QUEUE JOB
payload = { "callback_url" = "YOUR_CALLBACK_ENDPOINT" }
api.queue_job(job.id, payload)
# NOTE: Once the job is queued, it will get processed then complete
# We will send a response to the specified callback_url with the output photo download urls
require 'skylab_studio'
client = SkylabStudio::Client.new()
client = SkylabStudio::Client.new({ max_download_concurrency: 5 }) # to set download concurrency (default: 5)
# CREATE PROFILE
profile = client.create_profile({ name: "Test Profile", enable_crop: false, enable_color: false, enable_extract: true })
# CREATE JOB
job_name = "test-job-#{random_uuid}";
job = client.create_job({ name: job_name, profile_id: profile['id'] });
# UPLOAD PHOTO
file_path = "/path/to/photo.jpg";
client.upload_job_photo(file_path, job['id']);
# QUEUE JOB
queued_job = client.queue_job({ id: job['id'], callback_url: "http://server.callback.here/" });
# NOTE: Once the job is queued, it will get queued, processed, and then complete
# We will send a response to the specified callback_url with the output photo download urls
Updated 6 months ago
What’s Next