Skip to content

Commit e8d2377

Browse files
committed
README: Update documentation and installation instructions
1 parent 19c0caa commit e8d2377

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

README.md

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,52 @@ Basic implementation to access User, Project, Work in Progress and Collection da
77

88
See [http://be.net/dev](http://be.net/dev) for more information and documentation.
99

10+
Authentication
11+
--------------------
12+
Get an API key by registering your application here: [http://be.net/dev/register](http://be.net/dev/register)
13+
1014

11-
Installation / Usage
15+
Install via Composer
1216
--------------------
1317

14-
1. Please register for an application ID + key first: [http://be.net/dev/register](http://be.net/dev/register)
15-
2. Usage.
18+
```json
19+
{
20+
"require": {
21+
"behance/api-network": "~2.0.0"
22+
}
23+
}
24+
```
1625

17-
``` php
18-
require_once( './lib/Be/Api.php' );
26+
Usage
27+
--------------------
1928

20-
$api = new Be_Api( $client_id, $client_secret );
29+
``` php
30+
require_once( './vendor/autoload.php' );
2131

22-
// User data
23-
$api->getUser( 'bryan' );
32+
$client = new Behance\Api( $client_id );
2433

25-
// User's list of projects
26-
$api->getUserProjects( 'bryan' );
34+
// User data
35+
$client->getUser( 'bryan' );
2736

28-
// User's work in progress
29-
$api->getUserWips( 'cfaydi' );
37+
// User's list of projects
38+
$client->getUserProjects( 'bryan' );
3039

31-
// Project data
32-
$api->getProject( 2812719 );
40+
// User's work in progress
41+
$client->getUserWips( 'cfaydi' );
3342

34-
// Project's comments
35-
$api->getProjectComments( 2812719 );
43+
// Project data
44+
$client->getProject( 2812719 );
3645

37-
// Featured project list
38-
$api->searchProjects( array() );
46+
// Project's comments
47+
$client->getProjectComments( 2812719 );
3948

49+
// Featured project list
50+
$client->searchProjects( array() );
4051

41-
// Search for motorcycles
42-
$api->searchProjects( array( 'q' => 'motorcycles' ) );
52+
// Search for motorcycles
53+
$client->searchProjects( array( 'q' => 'motorcycles' ) );
4354

44-
```
55+
```
4556

4657
Requirements
4758
------------

0 commit comments

Comments
 (0)