Endpoints

Jobs

List all jobs

api.ListJobs();
await api.listJobs()
api.list_jobs()
client.list_jobs()

Create job

api.CreateJob(new { name = "Test Job", profileId = 123 });
await api.createJob({
  name: "your job name",
  profile_id: 123,
})
payload = {
  'profile_id': 1
}

api.create_job(payload=payload)
client.create_job({ name: "TEST JOB", profile_id: 123 })

For all payload options, consult the API documentation.

Get job

api.GetJob(jobId);
await api.getJob(jobId)
api.get_job(job_id)
client.get_job(123)

Update job

api.UpdateJob(jobId, new { name = "Updated Job Name" });
await api.updateJob(jobId, { name: "updated job name", profile_id: 456 })
payload = {
  'profile_id': 1
}
  
api.update_job(job_id, payload=paylod)

client.update_job(id: 123, { name: "new job name", profile_id: 456 })

Queue job

api.QueueJob(jobId, new { callback_url = "http://your.endpoint/"});
const payload = {
  callback_url: "desired_callback_url",
}

await api.queueJob(jobId, payload)
payload = {
  "callback_url": "desired_callback_url"
}

api.queue_job(job_id, payload)
client.queue_job({ id: 123, callback_url: "http://callback.url.here/ })

Delete job

api.DeleteJob(jobId);
await api.deleteJob(jobId)
api.delete_job(job_id)
client.delete_job(123)

Jobs in front

Use after queueing job to check the number of jobs ahead of yours.

api.JobsInFront(jobId);
await api.getJobsInFront(jobId)
api.fetch_jobs_in_front(job_id)
client.fetch_jobs_in_front(123)

Profiles

List all profiles

api.ListProfiles();
await api.listProfiles()
api.list_profiles()
client.list_profiles()

Create profile

api.CreateProfile(new { name = $"New Profile", enable_crop = false, enable_color = true });
await api.createProfile({
  name: "My Profile",
})
payload = {
  'name': 'My profile'
}

api.create_profile(payload=payload)
client.create_profile({ name: "New profile", enable_crop: false, enable_color: false, enable_extract: true })

For all payload options, consult the API documentation.

Get profile

api.GetProfile(profileId);
await api.getProfile(profileId)
api.get_profile(profile_id)
client.get_profile(123)

Update profile

api.UpdateProfile(profileId, new { name = $"Test Profile", enable_crop = false, enable_color = true });
payload = {
  name: "My updated profile name",
}

await api.updateProfile(profileId, payload)
payload = {
  'name': 'My profile'
}

api.update_profile(profile_id, payload=payload)
client.update_profile(123, { name: "new profile name", enable_color: true })

For all payload options, consult the API documentation.

Photos

Get photo

api.GetPhoto(photoId);
await api.getPhoto(photoId)
api.get_photo(photo_id)
client.get_photo(123)

Upload job photo

This function handles validating a photo, creating a photo object, and uploading it to your job/profile's s3 bucket. If the bucket upload process fails, it retries 3 times and if failures persist, the photo object is deleted.

api.UploadPhoto(photoPath, model, jobId)
await api.uploadJobPhoto(photoPath, jobId)
api.upload_job_photo(photo_path, job_id)
client.upload_job_photo('/path/to/photo.jpg', 123)

If the upload fails, the photo object is deleted for you. If the upload succeeds and you later decide you no longer want to include that image, use [Delete photo](#Delete photo) to remove it.

Upload profile photo

This function handles validating a background photo for a profile. Note: enable_extract and replace_background (profile attributes) MUST be true in order to create background photos. Follows the same upload process as upload_job_photo.

api.UploadPhoto("/path/to/photo", "profile", profileId);
await api.uploadProfilePhoto(photoPath, profileId);
api.upload_profile_photo(photo_path, profile_id)
client.upload_profile_photo('/path/to/photo.jpg', 123)

Delete photo

This will remove the photo from the job/profile's bucket. Useful for when you've accidentally uploaded an image that you'd like removed.

api.DeletePhoto(photoId)
await api.deletePhoto(photoId)
api.delete_photo(photo_id)
client.delete_photo(123)