-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from polidog/v2
Version2.0
- Loading branch information
Showing
16 changed files
with
1,090 additions
and
1,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ demo.php | |
vendor | ||
.idea | ||
.php_cs.cache | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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(['[email protected]','[email protected]']); | ||
$api->sendInvitation(['[email protected]','[email protected]']); | ||
// 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 | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.