Example #1
0
 public function testPutEvent()
 {
     Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
     Client::endpoint('https://api.relateiq.com/v2/events');
     Client::headers(["Content-type" => "application/json", "Accept" => "application/json"]);
     $data = ["subject" => "Support Ticket #12345: How do I create an event?", "body" => "Just called Tim and walked him through how to create an event with the new API.\n-James.", "participantIds" => [["type" => "email", "value" => "*****@*****.**"], ["type" => "email", "value" => "*****@*****.**"], ["type" => "phone", "value" => "8001235555"]]];
     $res = Client::put('', $data, []);
     $this->assertEquals(204, $res->code);
 }
Example #2
0
 public function delete($endpoint, $options = [])
 {
     $uri = Client::endpoint() . $endpoint . Client::getUriOptions($options);
     $response = \Httpful\Request::delete($uri)->authenticateWith(Client::key(), Client::secret())->addHeaders(Client::headers())->send();
     return $response;
 }