{"action":"created","comment":{"url":"https://api.github.com/repos/Cielo24/SampleCode/pulls/comments/28104999","id":28104999,"diff_hunk":"@@ -0,0 +1,322 @@\n+<?php\n+\n+require_once(\"WebUtils.php\");\n+\n+class Actions\n+{\n+\n+    public $BASE_URL;\n+    const API_VERSION = 1;\n+\n+    const LOGIN_PATH = \"/api/account/login\";\n+    const LOGOUT_PATH = \"/api/account/logout\";\n+    const UPDATE_PASSWORD_PATH = \"/api/account/update_password\";\n+    const GENERATE_API_KEY_PATH = \"/api/account/generate_api_key\";\n+    const REMOVE_API_KEY_PATH = \"/api/account/remove_api_key\";\n+    const CREATE_JOB_PATH = \"/api/job/new\";\n+    const AUTHORIZE_JOB_PATH = \"/api/job/authorize\";\n+    const DELETE_JOB_PATH = \"/api/job/del\";\n+    const GET_JOB_INFO_PATH = \"/api/job/info\";\n+    const GET_JOB_LIST_PATH = \"/api/job/list\";\n+    const ADD_MEDIA_TO_JOB_PATH = \"/api/job/add_media\";\n+    const ADD_EMBEDDED_MEDIA_TO_JOB_PATH = \"/api/job/add_media_url\";\n+    const GET_MEDIA_PATH = \"/api/job/media\";\n+    const PERFORM_TRANSCRIPTION = \"/api/job/perform_transcription\";\n+    const GET_TRANSCRIPT_PATH = \"/api/job/get_transcript\";\n+    const GET_CAPTION_PATH = \"/api/job/get_caption\";\n+    const GET_ELEMENT_LIST_PATH = \"/api/job/get_elementlist\";\n+    const GET_LIST_OF_ELEMENT_LISTS_PATH = \"/api/job/list_elementlists\";\n+\n+    public function __construct($base_url = \"https://api.cielo24.com\")\n+    {\n+        $this->BASE_URL = $base_url;\n+    }\n+\n+    /// ACCESS CONTROL ///\n+\n+    /* Performs a Login action. If useHeaders is true, puts username and password into HTTP headers */\n+    public function login($username, $password = null, $api_securekey = null, $use_headers = false)\n+    {\n+        $this->_assertArgument($username, \"Username\");\n+\n+        // Password or API Secure Key must be supplied but not both\n+        if ($password == null and $api_securekey == null) {\n+            throw new InvalidArgumentException(\"Password or API Secure Key must be supplied for login.\");\n+        }\n+\n+        $query_dict = $this->_initVersionDict();\n+        $headers = array();\n+\n+        if ($use_headers) {\n+            $headers[\"x-auth-user\"] = $username;\n+            if ($password != null) {\n+                $headers[\"x-auth-key\"] = $password;\n+            }\n+            if ($api_securekey != null) {\n+                $headers[\"x-auth-securekey\"] = $api_securekey;\n+            }\n+        } else {\n+            $query_dict[\"username\"] = $username;\n+            if ($password != null) {\n+                $query_dict[\"password\"] = $password;\n+            }\n+            if ($api_securekey != null) {\n+                $query_dict[\"securekey\"] = $api_securekey;\n+            }\n+        }\n+\n+        $response = WebUtils::getJson($this->BASE_URL, Actions::LOGIN_PATH, \"GET\", WebUtils::BASIC_TIMEOUT, $query_dict, $headers);\n+        return $response[\"ApiToken\"];\n+    }\n+\n+    /* Performs a Logout action */\n+    public function logout($api_token)\n+    {\n+        $query_dict = $this->_initAccessReqDict($api_token);\n+        // Nothing returned\n+        WebUtils::httpRequest($this->BASE_URL, Actions::LOGOUT_PATH, \"GET\", WebUtils::BASIC_TIMEOUT, $query_dict);\n+    }\n+\n+    /* Updates password */\n+    public function updatePassword($api_token, $new_password)\n+    {\n+        $this->_assertArgument($new_password, \"New Password\");\n+        $query_dict = $this->_initAccessReqDict($api_token);\n+        $query_dict[\"new_password\"] = $new_password;\n+        // Nothing returned\n+        WebUtils::httpRequest($this->BASE_URL, Actions::UPDATE_PASSWORD_PATH, \"POST\", WebUtils::BASIC_TIMEOUT, null, null, http_build_query($query_dict));\n+    }\n+\n+    /* Returns a new Secure API key */\n+    public function generateAPIKey($api_token, $username, $force_new = false)\n+    {\n+        $this->_assertArgument($username, \"Username\");\n+        $query_dict = $this->_initAccessReqDict($api_token);\n+        $query_dict[\"account_id\"] = $username;\n+        $query_dict[\"force_new\"] = ($force_new) ? 'true' : 'false';\n+\n+        $response = WebUtils::getJson($this->BASE_URL, Actions::GENERATE_API_KEY_PATH, \"GET\", WebUtils::BASIC_TIMEOUT, $query_dict);\n+        return $response[\"ApiKey\"];\n+    }\n+\n+    /* Deactivates the supplied Secure API key */\n+    public function removeAPIKey($api_token, $api_securekey)\n+    {\n+        $query_dict = $this->_initAccessReqDict($api_token);\n+        $query_dict[\"api_securekey\"] = $api_securekey;\n+        // Nothing returned\n+        WebUtils::httpRequest($this->BASE_URL, Actions::REMOVE_API_KEY_PATH, \"GET\", WebUtils::BASIC_TIMEOUT, $query_dict);\n+    }\n+\n+    /// JOB CONTROL ///\n+\n+    /* Creates a new job. Returns an array of Guids where 'JobId' is the 0th element and 'TaskId' is the 1st element */","path":"cielo24_PHP/src/cielo24/Actions.php","position":null,"original_position":113,"commit_id":"4aee5e2fda36c950408268699cbd7c3ba526bde3","original_commit_id":"da0eaeaf59b495ab327030d072873ae2ab9a202e","user":{"login":"echistyakov","id":7972340,"avatar_url":"https://avatars.githubusercontent.com/u/7972340?v=3","gravatar_id":"","url":"https://api.github.com/users/echistyakov","html_url":"https://github.com/echistyakov","followers_url":"https://api.github.com/users/echistyakov/followers","following_url":"https://api.github.com/users/echistyakov/following{/other_user}","gists_url":"https://api.github.com/users/echistyakov/gists{/gist_id}","starred_url":"https://api.github.com/users/echistyakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echistyakov/subscriptions","organizations_url":"https://api.github.com/users/echistyakov/orgs","repos_url":"https://api.github.com/users/echistyakov/repos","events_url":"https://api.github.com/users/echistyakov/events{/privacy}","received_events_url":"https://api.github.com/users/echistyakov/received_events","type":"User","site_admin":false},"body":"@mikeweaver The comment is fixed now.","created_at":"2015-04-09T21:35:01Z","updated_at":"2015-04-09T21:35:01Z","html_url":"https://github.com/Cielo24/SampleCode/pull/11#discussion_r28104999","pull_request_url":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/Cielo24/SampleCode/pulls/comments/28104999"},"html":{"href":"https://github.com/Cielo24/SampleCode/pull/11#discussion_r28104999"},"pull_request":{"href":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11","id":32637502,"html_url":"https://github.com/Cielo24/SampleCode/pull/11","diff_url":"https://github.com/Cielo24/SampleCode/pull/11.diff","patch_url":"https://github.com/Cielo24/SampleCode/pull/11.patch","issue_url":"https://api.github.com/repos/Cielo24/SampleCode/issues/11","number":11,"state":"open","locked":false,"title":"Feature/en 2024","user":{"login":"mikeweaver","id":1237513,"avatar_url":"https://avatars.githubusercontent.com/u/1237513?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeweaver","html_url":"https://github.com/mikeweaver","followers_url":"https://api.github.com/users/mikeweaver/followers","following_url":"https://api.github.com/users/mikeweaver/following{/other_user}","gists_url":"https://api.github.com/users/mikeweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeweaver/subscriptions","organizations_url":"https://api.github.com/users/mikeweaver/orgs","repos_url":"https://api.github.com/users/mikeweaver/repos","events_url":"https://api.github.com/users/mikeweaver/events{/privacy}","received_events_url":"https://api.github.com/users/mikeweaver/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-04T18:22:56Z","updated_at":"2015-04-09T21:35:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6cd73d3a6271a00006a822dedc7e7028af808dc7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11/commits","review_comments_url":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11/comments","review_comment_url":"https://api.github.com/repos/Cielo24/SampleCode/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cielo24/SampleCode/issues/11/comments","statuses_url":"https://api.github.com/repos/Cielo24/SampleCode/statuses/4aee5e2fda36c950408268699cbd7c3ba526bde3","head":{"label":"Cielo24:feature/EN-2024","ref":"feature/EN-2024","sha":"4aee5e2fda36c950408268699cbd7c3ba526bde3","user":{"login":"Cielo24","id":2947857,"avatar_url":"https://avatars.githubusercontent.com/u/2947857?v=3","gravatar_id":"","url":"https://api.github.com/users/Cielo24","html_url":"https://github.com/Cielo24","followers_url":"https://api.github.com/users/Cielo24/followers","following_url":"https://api.github.com/users/Cielo24/following{/other_user}","gists_url":"https://api.github.com/users/Cielo24/gists{/gist_id}","starred_url":"https://api.github.com/users/Cielo24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cielo24/subscriptions","organizations_url":"https://api.github.com/users/Cielo24/orgs","repos_url":"https://api.github.com/users/Cielo24/repos","events_url":"https://api.github.com/users/Cielo24/events{/privacy}","received_events_url":"https://api.github.com/users/Cielo24/received_events","type":"Organization","site_admin":false},"repo":{"id":21477654,"name":"SampleCode","full_name":"Cielo24/SampleCode","owner":{"login":"Cielo24","id":2947857,"avatar_url":"https://avatars.githubusercontent.com/u/2947857?v=3","gravatar_id":"","url":"https://api.github.com/users/Cielo24","html_url":"https://github.com/Cielo24","followers_url":"https://api.github.com/users/Cielo24/followers","following_url":"https://api.github.com/users/Cielo24/following{/other_user}","gists_url":"https://api.github.com/users/Cielo24/gists{/gist_id}","starred_url":"https://api.github.com/users/Cielo24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cielo24/subscriptions","organizations_url":"https://api.github.com/users/Cielo24/orgs","repos_url":"https://api.github.com/users/Cielo24/repos","events_url":"https://api.github.com/users/Cielo24/events{/privacy}","received_events_url":"https://api.github.com/users/Cielo24/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cielo24/SampleCode","description":"","fork":false,"url":"https://api.github.com/repos/Cielo24/SampleCode","forks_url":"https://api.github.com/repos/Cielo24/SampleCode/forks","keys_url":"https://api.github.com/repos/Cielo24/SampleCode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cielo24/SampleCode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cielo24/SampleCode/teams","hooks_url":"https://api.github.com/repos/Cielo24/SampleCode/hooks","issue_events_url":"https://api.github.com/repos/Cielo24/SampleCode/issues/events{/number}","events_url":"https://api.github.com/repos/Cielo24/SampleCode/events","assignees_url":"https://api.github.com/repos/Cielo24/SampleCode/assignees{/user}","branches_url":"https://api.github.com/repos/Cielo24/SampleCode/branches{/branch}","tags_url":"https://api.github.com/repos/Cielo24/SampleCode/tags","blobs_url":"https://api.github.com/repos/Cielo24/SampleCode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cielo24/SampleCode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cielo24/SampleCode/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cielo24/SampleCode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cielo24/SampleCode/statuses/{sha}","languages_url":"https://api.github.com/repos/Cielo24/SampleCode/languages","stargazers_url":"https://api.github.com/repos/Cielo24/SampleCode/stargazers","contributors_url":"https://api.github.com/repos/Cielo24/SampleCode/contributors","subscribers_url":"https://api.github.com/repos/Cielo24/SampleCode/subscribers","subscription_url":"https://api.github.com/repos/Cielo24/SampleCode/subscription","commits_url":"https://api.github.com/repos/Cielo24/SampleCode/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cielo24/SampleCode/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cielo24/SampleCode/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cielo24/SampleCode/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cielo24/SampleCode/contents/{+path}","compare_url":"https://api.github.com/repos/Cielo24/SampleCode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cielo24/SampleCode/merges","archive_url":"https://api.github.com/repos/Cielo24/SampleCode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cielo24/SampleCode/downloads","issues_url":"https://api.github.com/repos/Cielo24/SampleCode/issues{/number}","pulls_url":"https://api.github.com/repos/Cielo24/SampleCode/pulls{/number}","milestones_url":"https://api.github.com/repos/Cielo24/SampleCode/milestones{/number}","notifications_url":"https://api.github.com/repos/Cielo24/SampleCode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cielo24/SampleCode/labels{/name}","releases_url":"https://api.github.com/repos/Cielo24/SampleCode/releases{/id}","created_at":"2014-07-03T21:34:05Z","updated_at":"2015-04-02T19:06:09Z","pushed_at":"2015-04-09T21:34:19Z","git_url":"git://github.com/Cielo24/SampleCode.git","ssh_url":"git@github.com:Cielo24/SampleCode.git","clone_url":"https://github.com/Cielo24/SampleCode.git","svn_url":"https://github.com/Cielo24/SampleCode","homepage":null,"size":52085,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"Cielo24:master","ref":"master","sha":"08bc31319ac87a0a6635d0fc6e8856756a833aeb","user":{"login":"Cielo24","id":2947857,"avatar_url":"https://avatars.githubusercontent.com/u/2947857?v=3","gravatar_id":"","url":"https://api.github.com/users/Cielo24","html_url":"https://github.com/Cielo24","followers_url":"https://api.github.com/users/Cielo24/followers","following_url":"https://api.github.com/users/Cielo24/following{/other_user}","gists_url":"https://api.github.com/users/Cielo24/gists{/gist_id}","starred_url":"https://api.github.com/users/Cielo24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cielo24/subscriptions","organizations_url":"https://api.github.com/users/Cielo24/orgs","repos_url":"https://api.github.com/users/Cielo24/repos","events_url":"https://api.github.com/users/Cielo24/events{/privacy}","received_events_url":"https://api.github.com/users/Cielo24/received_events","type":"Organization","site_admin":false},"repo":{"id":21477654,"name":"SampleCode","full_name":"Cielo24/SampleCode","owner":{"login":"Cielo24","id":2947857,"avatar_url":"https://avatars.githubusercontent.com/u/2947857?v=3","gravatar_id":"","url":"https://api.github.com/users/Cielo24","html_url":"https://github.com/Cielo24","followers_url":"https://api.github.com/users/Cielo24/followers","following_url":"https://api.github.com/users/Cielo24/following{/other_user}","gists_url":"https://api.github.com/users/Cielo24/gists{/gist_id}","starred_url":"https://api.github.com/users/Cielo24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cielo24/subscriptions","organizations_url":"https://api.github.com/users/Cielo24/orgs","repos_url":"https://api.github.com/users/Cielo24/repos","events_url":"https://api.github.com/users/Cielo24/events{/privacy}","received_events_url":"https://api.github.com/users/Cielo24/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Cielo24/SampleCode","description":"","fork":false,"url":"https://api.github.com/repos/Cielo24/SampleCode","forks_url":"https://api.github.com/repos/Cielo24/SampleCode/forks","keys_url":"https://api.github.com/repos/Cielo24/SampleCode/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cielo24/SampleCode/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cielo24/SampleCode/teams","hooks_url":"https://api.github.com/repos/Cielo24/SampleCode/hooks","issue_events_url":"https://api.github.com/repos/Cielo24/SampleCode/issues/events{/number}","events_url":"https://api.github.com/repos/Cielo24/SampleCode/events","assignees_url":"https://api.github.com/repos/Cielo24/SampleCode/assignees{/user}","branches_url":"https://api.github.com/repos/Cielo24/SampleCode/branches{/branch}","tags_url":"https://api.github.com/repos/Cielo24/SampleCode/tags","blobs_url":"https://api.github.com/repos/Cielo24/SampleCode/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cielo24/SampleCode/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cielo24/SampleCode/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cielo24/SampleCode/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cielo24/SampleCode/statuses/{sha}","languages_url":"https://api.github.com/repos/Cielo24/SampleCode/languages","stargazers_url":"https://api.github.com/repos/Cielo24/SampleCode/stargazers","contributors_url":"https://api.github.com/repos/Cielo24/SampleCode/contributors","subscribers_url":"https://api.github.com/repos/Cielo24/SampleCode/subscribers","subscription_url":"https://api.github.com/repos/Cielo24/SampleCode/subscription","commits_url":"https://api.github.com/repos/Cielo24/SampleCode/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cielo24/SampleCode/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cielo24/SampleCode/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cielo24/SampleCode/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cielo24/SampleCode/contents/{+path}","compare_url":"https://api.github.com/repos/Cielo24/SampleCode/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cielo24/SampleCode/merges","archive_url":"https://api.github.com/repos/Cielo24/SampleCode/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cielo24/SampleCode/downloads","issues_url":"https://api.github.com/repos/Cielo24/SampleCode/issues{/number}","pulls_url":"https://api.github.com/repos/Cielo24/SampleCode/pulls{/number}","milestones_url":"https://api.github.com/repos/Cielo24/SampleCode/milestones{/number}","notifications_url":"https://api.github.com/repos/Cielo24/SampleCode/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cielo24/SampleCode/labels{/name}","releases_url":"https://api.github.com/repos/Cielo24/SampleCode/releases{/id}","created_at":"2014-07-03T21:34:05Z","updated_at":"2015-04-02T19:06:09Z","pushed_at":"2015-04-09T21:34:19Z","git_url":"git://github.com/Cielo24/SampleCode.git","ssh_url":"git@github.com:Cielo24/SampleCode.git","clone_url":"https://github.com/Cielo24/SampleCode.git","svn_url":"https://github.com/Cielo24/SampleCode","homepage":null,"size":52085,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11"},"html":{"href":"https://github.com/Cielo24/SampleCode/pull/11"},"issue":{"href":"https://api.github.com/repos/Cielo24/SampleCode/issues/11"},"comments":{"href":"https://api.github.com/repos/Cielo24/SampleCode/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/Cielo24/SampleCode/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cielo24/SampleCode/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/Cielo24/SampleCode/statuses/4aee5e2fda36c950408268699cbd7c3ba526bde3"}}}}