Endpoints

Jobs

List all jobs

api.ListJobs();
api.list_jobs()

Create job

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

api.create_job(payload=payload)

For all payload options, consult the API documentation.

Get job

api.GetJob(jobId);
api.get_job(job_id)

Update job

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

Queue job

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

api.queue_job(job_id, payload)

Delete job

api.DeleteJob(jobId);
api.delete_job(job_id)

Jobs in front

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

api.JobsInFront(jobId);
api.fetch_jobs_in_front(job_id)

Profiles

List all profiles

api.ListProfiles();
api.list_profiles()

Create profile

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

api.create_profile(payload=payload)

For all payload options, consult the API documentation.

Get profile

api.GetProfile(profileId);
api.get_profile(profile_id)

Update profile

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

api.update_profile(profile_id, payload=payload)

For all payload options, consult the API documentation.

List all photos

api.ListPhotos();
api.list_photos()

Photos

Get photo

api.GetPhoto(photoId);
api.get_photo(photo_id)

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)
api.upload_job_photo(photo_path, job_id)

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);
api.upload_profile_photo(photo_path, profile_id)

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)
api.delete_photo(photo_id)