cloudconvert / cloudconvert-php

CloudConvert PHP SDK
https://cloudconvert.com/api/v2
MIT License
222 stars 84 forks source link

Improve documentation #92

Closed filerun closed 1 year ago

filerun commented 2 years ago

Hi, I would really appreciate if you would:

josiasmontag commented 2 years ago

Sure, there is always room to make the documentation more detailed. However, the README file contains the typical example use cases. For details about specific methods you can also check the source code directly, which has DocComments and is pretty straightforward.

  • include some error reporting/handling examples

You can find all exceptions here: https://github.com/cloudconvert/cloudconvert-php/tree/master/src/Exceptions

  • give an example on how to list supported formats using this new library

This is currently not supported by the SDK. PRs are always welcome.

  • give some info on what the methods return and how to tell if the actions were successful or not

The methods return the Job/Task object if successful. Otherwise they throw an exception.

  • give info on tasks names (accepted formats, expected to be unique or not?)

This is documented here: https://cloudconvert.com/api/v2/jobs#jobs-create

  • give an example on how to check for the status of a task
$cloudconvert->tasks()->get('task-id') // returns task object
filerun commented 2 years ago
  • give an example on how to list supported formats using this new library

This is currently not supported by the SDK. PRs are always welcome.

Managed with this:

$ccHttp = new \CloudConvert\Transport\HttpTransport([]);
$response = $ccHttp->get($ccHttp->getBaseUri() .'/convert/formats', ['filter[input_format]' => 'pdf']);
json_decode($response->getBody(), true);

Thanks for the quick reply!

filerun commented 2 years ago

Any way to get a conversion task's progress?

joshv2 commented 2 years ago

Can you also please give an example of how to access the user's account infor (e.g. remaining credits, etc). Thanks.