本文整理汇总了PHP中Client::relateIQ方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::relateIQ方法的具体用法?PHP Client::relateIQ怎么用?PHP Client::relateIQ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::relateIQ方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testListsGetAll
public function testListsGetAll()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
Lists::setFetchOptions(["_ids" => "53ae0c09e4b0f0eb6bc57ecd"]);
$lists = Lists::fetchPage();
$this->assertNotNull($lists);
}
示例2: testAccountSaveCreate
public function testAccountSaveCreate()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
$account = new Account(['name' => 'Account Created']);
$res = $account->save();
$this->assertInstanceOf('Account', $res);
$this->assertEquals('Account Created', $res->name());
}
示例3: testUsers
public function testUsers()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
$data = ['id' => '538530d2e4b00530d85ae1bf', 'name' => 'Juan Perez', 'email' => 'juan@gmail.com'];
$other = new User(['data' => $data]);
$this->assertInstanceOf('User', $other);
$this->assertEquals($data['id'], $other->id());
$this->assertEquals($data['name'], $other->name());
$this->assertEquals($data['email'], $other->email());
}
示例4: testEvent
public function testEvent()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
$event = new Events([]);
$event->subject("Support Ticket #12345: How do I create an event?");
$event->body("Just called Tim and walked him through how to create an event with the new API.\n He'll reach out to support@relateiq.com with any questions he might have.\n Resolving.\n - James");
$participantIds = [["type" => "email", "value" => "james.mcsales@relateiq.com"], ["type" => "email", "value" => "tim.archer@avocado.com"], ["type" => "phone", "value" => "8001235555"]];
$event->participantIds($participantIds);
$res = $event->update();
$this->assertInstanceOf('Events', $res);
}
示例5: testListitemDelete
public function testListitemDelete()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
$data = ["id" => "53ae0c09e4b0f0eb6bc57ecd"];
$listObj = new Lists($data);
$this->assertNotNull($listObj->id());
//Creating ListItems...
$account = new Account([]);
$contact = new Contact(["id" => "53b4b4cce4b0e6c80c5fca0c"]);
$listItem = new ListItems(["parent" => $listObj]);
$listItem->accountId($account->id());
$listItem->contactIds($contact->id());
$listItem->name("MASH Realtors");
$listItem->fieldValues(["0" => "5", "2" => "0"]);
$res = $listItem->create();
$this->assertNotNull($res->id());
$idList = $res->id();
//Deleting ListItems...
$listItem = $listObj->ListItem($idList);
$res = $listItem->delete();
$this->assertEquals(true, $res);
}
示例6: testContactLimit
public function testContactLimit()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
$testLimit = 1;
Contact::setPageSize($testLimit);
$this->assertEquals($testLimit, Contact::getPageSize());
$contacts = Contact::fetchByIds(["54ee0ed6e4b08099b9917451"]);
$this->assertNotNull($contacts["54ee0ed6e4b08099b9917451"]->id());
$this->assertNotNull($contacts["54ee0ed6e4b08099b9917451"]->name());
$contacts2 = Contact::fetchByIds([]);
$this->assertEquals([], $contacts2);
}
示例7: testPutEvent
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" => "james.mcsales@relateiq.com"], ["type" => "email", "value" => "tim.archer@avocado.com"], ["type" => "phone", "value" => "8001235555"]]];
$res = Client::put('', $data, []);
$this->assertEquals(204, $res->code);
}