Getting Started & Installation
Installation
$ nuget install SkylabStudio
$ $ pip install skylab_studio
Example Usage
using Skylabstudio;
var apiClient = new StudioClient("YOUR_SKYLAB_API_TOKEN");
import skylab_studio
api = skylab_studio.api(api_key='YOUR-API-KEY')
// 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
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
Updated 24 days ago
What’s Next