Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
polidog committed Jan 28, 2018
1 parent 1e7f858 commit 0e653ef
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Total Downloads](https://poser.pugx.org/polidog/esa-php/downloads)](https://packagist.org/packages/polidog/esa-php)
[![License](https://poser.pugx.org/polidog/esa-php/license)](https://packagist.org/packages/polidog/esa-php)

esa API v1 client library, written in PHP
esa API v2 client library, written in PHP

## Installation

Expand All @@ -30,129 +30,129 @@ composer.phar require polidog/esa-php
require 'vendor/autoload.php';
$client = new Polidog\Esa\Client("<access_token>", "foobar");
$api = \Polidog\Esa\Api::factory("<access_token>", "foobar");
$client->user();
$api->user();
// GET /v1/user
$client->teams();
$api->teams();
// GET /v1/teams
$client->team('bar');
$api->team('bar');
// GET /v1/teams/bar
$client->stats()
$api->stats()
// GET /v1/teams/foobar/stats
$client->members();
$api->members();
// GET /v1/teams/foobar/members
$client->posts();
$api->posts();
// GET /v1/teams/foobar/posts
$client->posts(["q" => "in:help"]);
$api->posts(["q" => "in:help"]);
// GET /v1/teams/foobar/posts?q=in%3Ahelp
$client->createPost(["name" => "foo"]);
$api->createPost(["name" => "foo"]);
// POST /v1/teams/foobar/posts
$client->updatePost(1, ["name" => "bar"]);
$api->updatePost(1, ["name" => "bar"]);
// PATCH /v1/teams/foobar/posts/1
$client->deletePost(1);
$api->deletePost(1);
// DELETE /v1/teams/foobar/posts/1
// Comment API
$client->comments(1); /* post number */
$api->comments(1); /* post number */
// GET /v1/teams/foobar/posts/1/comments
$client->createComment(1, ['body_md' => 'baz']);
$api->createComment(1, ['body_md' => 'baz']);
// POST /v1/teams/foobar/posts/1/comments
$client->comment(123); /* comment id */
$api->comment(123); /* comment id */
// GET /v1/teams/foobar/comments/123
$client->updateComment(123, ['body_md' => 'bazbaz']);
$api->updateComment(123, ['body_md' => 'bazbaz']);
// PATCH /v1/teams/foobar/comments/123
$client->deleteComment(123);
$api->deleteComment(123);
// DELETE /v1/teams/foobar/comments/123
$client->comments();
$api->comments();
// GET /v1/teams/foobar/comments
$client->createSharing(1);
$api->createSharing(1);
// POST /v1/teams/foobar/posts/1/sharing
$client->deleteSharing(1);
$api->deleteSharing(1);
// DELETE /v1/teams/foobar/posts/1/sharing
# Star API
$client->postStargazers(1);
$api->postStargazers(1);
// GET /v1/teams/foobar/posts/1/stargazers
$client->addPostStar(1);
$api->addPostStar(1);
// POST /v1/teams/foobar/posts/1/star
$client->deletePostStar(1);
$api->deletePostStar(1);
// DELETE /v1/teams/foobar/posts/1/star
$client->commentStargazers(123);
$api->commentStargazers(123);
// GET /v1/teams/foobar/comments/123/stargazers
$client->addCommentStar(123);
$api->addCommentStar(123);
// POST /v1/teams/foobar/comments/123/star
$client->deleteCommentStar(123);
$api->deleteCommentStar(123);
// DELETE /v1/teams/foobar/comments/123/star
# Watch API
$client->watchers(1);
$api->watchers(1);
// GET /v1/teams/foobar/posts/1/watchers
$client->addWatch(1);
$api->addWatch(1);
// POST /v1/teams/foobar/posts/1/watch
$client->deleteWtach(1);
$api->deleteWtach(1);
// DELETE /v1/teams/foobar/posts/1/watch
# Categories API
$client->categories();
$api->categories();
// GET /v1/teams/foobar/categories
# Tags API
$client->tags();
$api->tags();
// GET /v1/teams/foobar/tags
# Invitation API
$client->invitation();
$api->invitation();
// GET /v1/teams/foobar/invitation
$client->regenerateInvitation();
$api->regenerateInvitation();
// POST /v1/teams/foobar/invitation_regenerator
$client->pendingInvitations();
$api->pendingInvitations();
// GET /v1/teams/foobar/invitations
$client->sendInvitation(['test@test.com','test2@test.com']);
$api->sendInvitation(['test@test.com','test2@test.com']);
// POST /v1/teams/foobar/invitations
$client->cancelInvitation($code);
$api->cancelInvitation($code);
// DELETE /v1/teams/foobar/invitations/baz
# Emoji API
$client->emojis();
$api->emojis();
// GET /v1/teams/foobar/emojis
$client->createEmoji(['code' => 'team_emoji', image: '/path/to/image');
$api->createEmoji(['code' => 'team_emoji', image: '/path/to/image');
// POST /v1/teams/foobar/emojis
$client->createEmoji(['code' => 'alias_code', origin_code: 'team_emoji');
$api->createEmoji(['code' => 'alias_code', origin_code: 'team_emoji');
// POST /v1/teams/foobar/emojis
$client->deleteEmoji('team_emoji');
$api->deleteEmoji('team_emoji');
// DELETE /v1/teams/foobar/emojis/team_emoji
```

Expand Down

0 comments on commit 0e653ef

Please sign in to comment.