PHP code example of staffkojinpro / backlog-api

1. Go to this page and download the library: Download staffkojinpro/backlog-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

staffkojinpro / backlog-api example snippets


$backlog = new Backlog(new ApiKeyConnector('Your Backlog Space ID', 'Your API KEY'[, string $domain = 'jp']));

$backlog->statuses();

$backlog->resolutions();

$backlog->priorities();

$backlog->addStar([array $form_options = []]);

$backlog->space->info();

$backlog->space->notification();

$backlog->space->activities();

$backlog->space->putNotification(string $content_body);

$backlog->space->diskUsage();

$multipart = [
    [
        'name' => 'file',
        'contents' => fopen('test.txt', 'r'),
        'filename' => 'file name',
        'headers' => [
            'Content-Type' => 'application/octet-stream'
        ]
    ]
];
$backlog->space->postAttachment(array $multipart);

$backlog->users->load();

$backlog->users->find(int $user_id);

$backlog->users->create(int $user_id, string $password, string $name, string $mail_address, int $role_type);

$backlog->users->myself();

$backlog->users->activities(int $user_id[, array $query_params = []]);

$backlog->users->stars(int $user_id[, array $query_params = []]);

$backlog->users->numberOfStars(int $user_id[, array $query_params = []]);

$backlog->users->recentlyViewedIssues([array $query_params = []]);

$backlog->users->recentlyViewedProjects([array $query_params = []]);

$backlog->users->recentlyViewedWikis([array $query_params = []]);

$backlog->groups->load([array $query_params = []]);

$backlog->groups->find(int $group_id);

$backlog->projects->load([array $query_params = []]);

$backlog->projects->statuses(string $project_id_or_key);

$backlog->projects->find(string $project_id_or_key);

$backlog->projects->activities(string $project_id_or_key[, array $query_params = []]);

$backlog->projects->users(string $project_id_or_key);

$backlog->projects->administrators(string $project_id_or_key);

$backlog->projects->issueTypes(string $project_id_or_key);

$backlog->projects->createIssueType(string $project_id_or_key, string $name, string $color);

$backlog->projects->updateIssueType(string $project_id_or_key, int $issue_type_id[, array $form_options = []]);

$backlog->projects->deleteIssueType(string $project_id_or_key, int $issue_type_id, int $substitute_issue_type_id);

$backlog->projects->categories(string $project_id_or_key);

$backlog->projects->createCategory(string $project_id_or_key, string $name);

$backlog->projects->updateCategory(string $project_id_or_key, int $category_id[, array $form_options = []]);

$backlog->projects->deleteCategory(string $project_id_or_key, int $category_id);

$backlog->projects->versions(string $project_id_or_key);

$backlog->projects->createVersion(string $project_id_or_key, string $name[, array $form_options = []]);

$backlog->projects->updateVersion(string $project_id_or_key, int $version_id, string $name[, array $form_options = []]);

$backlog->projects->deleteVersion(string $project_id_or_key, int $version_id);

$backlog->projects->diskUsage(string $project_id_or_key);

$backlog->issues->load([array $query_options = []]);

$backlog->issues->count([array $query_options = []]);

$backlog->issues->find(string $issues_id_or_key);

$backlog->issues->update(string $issues_id_or_key[, array $form_options = []]);

$backlog->issues->delete(string $issues_id_or_key);

$backlog->issues->comments(string $issues_id_or_key[, array $query_options = []]);

$backlog->issues->numberOfComments(string $issues_id_or_key);

$backlog->issues->findComment(string $issues_id_or_key, int $comment_id);

$backlog->issues->updateComment(string $issues_id_or_key, int $comment_id[, array $form_options = []]);

$backlog->issues->commentNotifications(string $issues_id_or_key, int $comment_id);

$backlog->issues->createCommentNotification(string $issues_id_or_key, int $comment_id[, array $form_options = []]);

$backlog->issues->attachments(string $issues_id_or_key);

$backlog->issues->attachment(string $issues_id_or_key, string $attachment_id);

$backlog->issues->sharedFiles(string $issues_id_or_key);

$backlog->wikis->load(string $project_id_or_key);

$backlog->wikis->count($project_id_or_key);

$backlog->wikis->tags($project_id_or_key);

$backlog->wikis->create(int $project_id, string $name, string $content[, array $form_options = []]);

$backlog->wikis->find(int $wiki_id);

$backlog->wikis->update(int wiki_id[, array $form_options = []);

$backlog->wikis->delete(int $wiki_id);

$backlog->wikis->attachments(int $wiki_id);

$backlog->wikis->history(int $wiki_id[, array $query_options = []]);

$backlog->wikis->stars(int $wiki_id);

$backlog->notifications->load([array $query_options = []]);

$backlog->notifications->count([array $query_options = []]);

$backlog->notifications->markAllAsRead();

$backlog->notifications->markAsRead(int $notification_id);

$backlog->git->repositories(string $project_id_or_key);

$backlog->git->findRepositories(string $project_id_or_key, string $repository_id_or_name);

$backlog->git->pullRequests(string $project_id_or_key, string $repository_id_or_name[, array $query_options = []]);

$backlog->git->numberOfPullRequests(string $project_id_or_key, string $repository_id_or_name[, array $query_options = []]);

$backlog->git->createPullRequests(string $project_id_or_key, string $repository_id_or_name, string $summary, string $description, string $base_branch, string $merge_branch[, array $form_options = []]);

$backlog->git->findPullRequest(string $project_id_or_key, string $repository_id_or_name, int $pull_request_number);

$backlog->git->updatePullRequest(string $project_id_or_key, string $repository_id_or_name, int $pull_request_number[, array $form_options = []]);

$backlog->git->pullRequestComments(string $project_id_or_key, string $repository_id_or_name, int $pull_request_number[, array $query_options = []]);

$backlog->git->createPullRequestComment(string $project_id_or_key, string $repository_id_or_name,  int $pull_request_number, string $content[, array $form_options = []]);

$backlog->git->numberOfPullRequestComments(string $project_id_or_key, string $repository_id_or_name, int $pull_request_number);

$backlog->git->updatePullRequestComment(string $project_id_or_key, string $repository_id_or_name, int $pull_request_number, int $comment_id[, array $form_options = []]);

$backlog->git->pullRequestAttachments(string $project_id_or_key, string $repository_id_or_name, int $pull_request_number);

$backlog->watchings->load(int $user_id[, array $query_options = []]);

$backlog->watchings->count(int $user_id[, array $query_options = []]);

$backlog->watchings->find(int $watching_id);

$backlog->watchings->create(string $issues_id_or_key[, array $form_options = []]);

$backlog->watchings->update(int $watching_id[, array $form_options = []]);

$backlog->watchings->delete(int $watching_id);

$backlog->watchings->markAsRead(int $watching_id);
 php
$backlog->issues->createComment(string $issues_id_or_key, string $content[, array $form_options = []]);