Skip to content

Commit

Permalink
STD-1 fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
2lives committed Apr 17, 2024
1 parent 5a68d12 commit da5f746
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ $profilePayload = [
'enable_retouch' => true
]

$profile = $api.createProfile(profilePayload)
$profile = $api->createProfile($profilePayload)

// CREATE JOB
$jobPayload = [
'name' => 'job name',
'profile_id' => profile.id
'profile_id' => $profile['id']
]

$job = $api.createJob(jobPayload)
$job = $api->createJob($jobPayload)

// UPLOAD JOB PHOTO(S)
$filePath = '/path/to/photo'
$api.uploadJobPhoto($filePath, $job->id)
$api->uploadJobPhoto($filePath, $job->id)

// QUEUE JOB
$payload = [ 'callback_url' => 'YOUR_CALLBACK_ENDPOINT' ]
$api.queueJob(job.id, $payload)
$api->queueJob(job.id, $payload)

// NOTE: Once the job is queued, it will transition to processed and then completed
// We will send a response to the specified callback_url with the output photo download urls
Expand All @@ -51,7 +51,7 @@ $api.queueJob(job.id, $payload)
List the last 30 jobs.

```php
$api.listJobs();
$api->listJobs();
```

### Create a Job
Expand All @@ -63,21 +63,21 @@ $payload = [
'profile_id' => 123
]

$api.createJob($payload);
$api->createJob($payload);
```

For all payload options, consult the [API documentation](https://studio-docs.skylabtech.ai/#tag/job/operation/createJob).

### Get a Job

```php
$api.getJob($jobId);
$api->getJob($jobId);
```

### Get Job by Name

```php
$api.getJobByName($name);
$api->getJobByName($name);
```

### Update a Job
Expand All @@ -88,7 +88,7 @@ $payload = [
'profile_id' => 123
]

$api.updateJob($jobId, $payload);
$api->updateJob($jobId, $payload);
```

For all payload options, consult the [API documentation](https://studio-docs.skylabtech.ai/#tag/job/operation/updateJobById).
Expand All @@ -98,39 +98,39 @@ For all payload options, consult the [API documentation](https://studio-docs.sky
```php
$payload = [ 'callback_url' => 'YOUR_CALLBACK_ENDPOINT' ]

$api.queueJob($jobId, $payload);
$api->queueJob($jobId, $payload);
```

### Jobs in Front

```php
$api.getJobsInFront($jobId);
$api->getJobsInFront($jobId);
```

### Delete a Job

```php
$api.deleteJob($jobId);
$api->deleteJob($jobId);
```

### Cancel a Job

```php
$api.cancelJob($jobId);
$api->cancelJob($jobId);
```

## Profiles

### List all Profiles

```php
$api.listProfiles();
$api->listProfiles();
```

### Create a Profile

```php
$api.createProfile([
$api->createProfile([
'name' => 'My Profile'
]);
```
Expand All @@ -140,7 +140,7 @@ For all payload options, consult the [API documentation](https://studio-docs.sky
### Get a Profile

```php
$api.getProfile($profileId);
$api->getProfile($profileId);
```

### Update profile
Expand All @@ -150,7 +150,7 @@ $payload = [
'name' => 'My updated profile name',
];

$api.updateProfile($profileId, $payload);
$api->updateProfile($profileId, $payload);
```

For all payload options, consult the [API documentation](https://studio-docs.skylabtech.ai/#tag/profile/operation/updateProfileById).
Expand All @@ -162,7 +162,7 @@ For all payload options, consult the [API documentation](https://studio-docs.sky
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.

```php
$api.uploadJobPhoto($photoPath, $jobId);
$api->uploadJobPhoto($photoPath, $jobId);
```

`Returns: { photo: { photoObject }, uploadResponse: bucketUploadResponseStatus }`
Expand All @@ -172,13 +172,13 @@ If upload fails, the photo object is deleted for you. If upload succeeds and you
### Get a Photo

```php
$api.getPhoto($photoId);
$api->getPhoto($photoId);
```

### Delete a Photo

```php
$api.deletePhoto($photoId);
$api->deletePhoto($photoId);
```

### Validate HMAC Headers
Expand All @@ -189,7 +189,7 @@ $api.deletePhoto($photoId);
- signature: Signature header received in callback under 'X-Skylab-Signature'

```php
$api.validateHmacHeaders($secretKey, $jobJson, $requestTimestamp, $signature);
$api->validateHmacHeaders($secretKey, $jobJson, $requestTimestamp, $signature);
```

## Troubleshooting
Expand Down

0 comments on commit da5f746

Please sign in to comment.