Skip to content

Commit

Permalink
Update the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lildude committed Jul 1, 2016
1 parent af3fec6 commit 81a47c4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
15 changes: 11 additions & 4 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ phpZenfolio allows you to use the API methods as documented, however to make thi

* Challenge-Response (default):

```
$client->login("<username>", "<password>");
```php
$client->login('[USERNAME]', '[PASSWORD]');
```

* Plain-Text:

```
```php
# Setting the third argument to `true` confirms you want to use plain-text
$client->login("<username>", "<password>", true);
$client->login('[USERNAME]', '[PASSWORD]', true);
```

Both methods use HTTPS/SSL for the authentication step to ensure your username and password are encrypted when transmitted to Zenfolio.

The `login()` method returns the authentication token. You can store this and re-use it in future requests using phpZenfolio's `setAuthToken()` method:

```php
$client = new phpZenfolio\Client('My Cool App/1.0 (http://app.com)'));
$client->setAuthToken('[AUTH_TOKEN]');
```
6 changes: 3 additions & 3 deletions docs/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
Accessing Zenfolio with phpZenfolio through a proxy is possible by passing the `proxy` option when instantiating the client:

```php
$client = new phpZenfolio\Client('My Cool App/1.0 (http://app.com)', ['proxy' => 'http://[proxy_address]:[port]']));
$client = new phpZenfolio\Client('My Cool App/1.0 (http://app.com)', ['proxy' => 'http://[PROXY_ADDRESS]:[PORT]']));
```

All your requests will pass through the specified proxy on the specified port.

If you need a username and password to access your proxy, you can include them in the URL in the form: `http://[username]:[password]@[proxy_address]:[port]`.
If you need a username and password to access your proxy, you can include them in the URL in the form: `http://[USERNAME]:[PASSWORD]@[PROXY_ADDRESS]:[PORT]`.

## Image URLs Helper

Expand All @@ -21,7 +21,7 @@ To make it easy to obtain the direct URL to an image, phpZenfolio supplies an `i

```
$client = new phpZenfolio\Client('My Cool App/1.0 (http://app.com)');
$photos = $client->LoadPhotoSetPhotos(<photosetID>, <startingIndex>, <numberOfPhotos>);
$photos = $client->LoadPhotoSetPhotos('[PHOTOSETID]', [STARTINGINDEX], [NUMBEROFPHOTOS]);
foreach ($photos as $photo) {
echo '<img src="'.phpZenfolio\Client::imageUrl($photo, 1).'" />';
}
Expand Down
33 changes: 13 additions & 20 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,11 @@ Remember: *ALL* function names and arguments *ARE* case sensitive and the order
**Note:** phpZenfolio does not currently support asynchronous requests, though as we now rely on Guzzle, this shouldn't be too hard to implement in future.


### Making Changes
### Creating Objects and Making Changes

TBC
Some of the Zenfolio API methods, like `CreatePhotoSet()`, or `UpdatePhoto()` require an [Updater object](http://www.zenfolio.com/zf/help/api/ref/objects/updaters) to be passed as one of the arguments. phpZenfolio allows you to pass the object either as an associative array:


### Special Cases

TBC - It's possible the use of JSON negates the need to differentiate.

Some of the Zenfolio API methods, like `CreatePhotoSet()`, require an object to be passed as one of the arguments. The object can be passed either as an associative array:

```
```php
$photoSetUpdater = array(
"Title" => "PhotoSet Title",
"Caption" => "PhotoSet Caption via API",
Expand All @@ -63,18 +56,18 @@ $photoSetUpdater = array(
"CustomReference" => "testing/test-photoset"
);
$client->CreatePhotoSet(12345, 'Gallery', $photoSetUpdater);
```
```

... or as a standard class object:

```
$photoSetUpdater = new stdClass();
$photoSetUpdater->Title = "PhotoSet Title";
$photoSetUpdater->Caption = "PhotoSet Caption via Object";
$photoSetUpdater->Keywords = array("Keyword1", "keyword2");
$photoSetUpdater->Categories = array();
$photoSetUpdater->CustomReference = "testing/test-photoset";
$client->CreatePhotoSet(12345, 'Gallery', $photoSetUpdater);
```
```php
$photoSetUpdater = new stdClass();
$photoSetUpdater->Title = "PhotoSet Title";
$photoSetUpdater->Caption = "PhotoSet Caption via Object";
$photoSetUpdater->Keywords = array("Keyword1", "keyword2");
$photoSetUpdater->Categories = array();
$photoSetUpdater->CustomReference = "testing/test-photoset";
$client->CreatePhotoSet(12345, 'Gallery', $photoSetUpdater);
```

All data returned by the method call is returned as the API documents it.

0 comments on commit 81a47c4

Please sign in to comment.