/** * Test executing requests to Beepsend API */ public function testExecute() { $connector = \Mockery::mock(new Curl()); $connector->shouldReceive('call')->withAnyArgs()->once()->andReturn(array('info' => array('http_code' => 200, 'Content-Type' => 'application/json'), 'response' => json_encode(array('msg' => 'Welcome to Beepsend!')))); $request = new Request('SomeSecretToken', $connector); $response = $request->execute('/'); $this->assertEquals('Welcome to Beepsend!', $response['msg']); }
/** * Search for groups * @param string $query Will search entries with matching name * @return array */ public function groups($query) { $data = array('query' => $query); $response = $this->request->execute($this->actions['groups'], 'GET', $data); return $response; }
/** * Delete contact group * @param int $groupId * @return array */ public function deleteGroup($groupId) { $response = $this->request->execute($this->actions['groups'] . $groupId, 'DELETE'); return $response; }
/** * Recive list of recipient numbers which can receive mobile originated messages * @return array */ public function recipientNumbers() { $response = $this->request->execute($this->actions['numbers'], 'GET'); return $response; }
/** * Compare pricelist revisions from given connection and return their diff. * @param int $revision1 * @param int $revision2 * @param mixed $connection * @return array */ public function diff($revision1, $revision2, $connection) { $response = $this->request->execute($this->actions['pricelists'] . $connection . '/' . $revision1 . '..' . $revision2 . $this->actions['diff']); return $response; }
/** * Get customer data * @return array */ public function get() { $response = $this->request->execute($this->actions['data'], 'GET'); return $response; }
/** * Delete external email for notifications to wallet. * @param int $walletId Wallet id * @param int $emailId Email id * @return array */ public function deleteNotificationEmail($walletId, $emailId) { $response = $this->request->execute($this->actions['wallets'] . $walletId . $this->actions['notifications'] . $emailId, 'DELETE'); return $response; }
/** * Validate HLR request * @param int $msisdn Msisdn that we are looking HLR request * @param string $connection Connection id * @return array */ public function validate($msisdn, $connection = 'me') { $response = $this->request->execute($this->actions['validate'], 'POST', array('msisdn' => $msisdn, 'connection' => $connection)); return $response; }
/** * After changing your phone number. An SMS will be sent out asking you to verify the change. Use the unique hash to verify. * @param string $hash * @return array */ public function verifyPhone($hash) { $response = $this->request->execute($this->actions['users'] . $this->actions['phone'] . '/' . $hash, 'GET'); return $response; }
/** * List all messages sent back and forth in to a single contact/number. * @param string $id * @return array */ public function fullConversation($id, $options = array()) { $response = $this->request->execute($this->actions['conversations'] . $id, 'GET', $options); return $response; }