{"action":"created","issue":{"url":"https://api.github.com/repos/infusionsoft/infusionsoft-php/issues/93","repository_url":"https://api.github.com/repos/infusionsoft/infusionsoft-php","labels_url":"https://api.github.com/repos/infusionsoft/infusionsoft-php/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/infusionsoft/infusionsoft-php/issues/93/comments","events_url":"https://api.github.com/repos/infusionsoft/infusionsoft-php/issues/93/events","html_url":"https://github.com/infusionsoft/infusionsoft-php/issues/93","id":189424310,"number":93,"title":"Unable to access REST Hook API","user":{"login":"ashitvora","id":140315,"avatar_url":"https://avatars.githubusercontent.com/u/140315?v=3","gravatar_id":"","url":"https://api.github.com/users/ashitvora","html_url":"https://github.com/ashitvora","followers_url":"https://api.github.com/users/ashitvora/followers","following_url":"https://api.github.com/users/ashitvora/following{/other_user}","gists_url":"https://api.github.com/users/ashitvora/gists{/gist_id}","starred_url":"https://api.github.com/users/ashitvora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashitvora/subscriptions","organizations_url":"https://api.github.com/users/ashitvora/orgs","repos_url":"https://api.github.com/users/ashitvora/repos","events_url":"https://api.github.com/users/ashitvora/events{/privacy}","received_events_url":"https://api.github.com/users/ashitvora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-15T15:35:52Z","updated_at":"2016-11-15T15:41:02Z","closed_at":null,"body":"I updated my SDK to 1.2.x and trying to register for Hook Events but I do not see ResthookService.php class in API folder.\r\n\r\nMoreover I do not see resthooks() method in Infusionsoft/Infusionsoft class.\r\n\r\nI tried creating the class myself looking at other RESTApi Classes like below...\r\n\r\n```\r\nreturn $this->client->restfulRequest('post', $this->getFullUrl($this->key))->create([\r\n\t\t\t'eventKey' => 'contact.add',\r\n\t\t\t'hookUrl' => 'https://hook.url/1582a08005ssd4j48nspad14d9',\r\n\t\t]);\r\n```\r\n\r\nBut I get following error...\r\n\r\n```\r\n{\"error\":\"GuzzleHttp\\\\Exception\\\\ClientException: Client error: `POST https:\\/\\/api.infusionsoft.com\\/crm\\/rest\\/v1\\/hooks\\/?access_token=<access toke> resulted in a 400 Bad Request response:\\n{\\\"message\\\":\\\"Input could not be converted to a valid request\\\"}\r\n```"},"comment":{"url":"https://api.github.com/repos/infusionsoft/infusionsoft-php/issues/comments/260675807","html_url":"https://github.com/infusionsoft/infusionsoft-php/issues/93#issuecomment-260675807","issue_url":"https://api.github.com/repos/infusionsoft/infusionsoft-php/issues/93","id":260675807,"user":{"login":"micfai","id":2048552,"avatar_url":"https://avatars.githubusercontent.com/u/2048552?v=3","gravatar_id":"","url":"https://api.github.com/users/micfai","html_url":"https://github.com/micfai","followers_url":"https://api.github.com/users/micfai/followers","following_url":"https://api.github.com/users/micfai/following{/other_user}","gists_url":"https://api.github.com/users/micfai/gists{/gist_id}","starred_url":"https://api.github.com/users/micfai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micfai/subscriptions","organizations_url":"https://api.github.com/users/micfai/orgs","repos_url":"https://api.github.com/users/micfai/repos","events_url":"https://api.github.com/users/micfai/events{/privacy}","received_events_url":"https://api.github.com/users/micfai/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T15:41:02Z","updated_at":"2016-11-15T15:41:02Z","body":"Are you using 1.2.4-beta? With this release you can do the following:\r\n\r\n```php\r\n$resthook = $infusionsoft->resthooks()->create([\r\n\t\t'eventKey' => 'contact.add',\r\n\t\t'hookUrl' => 'http://infusionsoft.app/verifyRestHook.php'\r\n\t]);\r\n```"}}
{"actor":{"display_login":"micfai"}}