Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some recipient API methods #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ All methods return an array containing a **success** boolean, and the **data** -
Advanced
----
```
$SM = new SurveyMonkey("myApiKey" , "myAccessToken",
$SM = new SurveyMonkey("myApiKey" , "myAccessToken",
array( // Override default API options (quite useless at the moment)
'protocol' => 'http', // will not work.. they require SSL
'hostname' => 'fake-api.surveymonkey.net' // will also not work..
),
),
array( // CURL override options
CURLOPT_SSL_VERIFYPEER => false // Better add cacert.pam, no?
// ...<Any CURLOPT>...
Expand Down Expand Up @@ -136,6 +136,31 @@ public function createFlow($surveyTitle, $from_survey_id, $params = array()){}
*/
public function updateSurvey($surveyID, $params = array()){}
```

**getMessageRecipients**
```
/**
* Gets recipient summaries for all recipients of a message
* @see https://developer.surveymonkey.com/api/v3/#collectors-id-messages-id-recipients
* @param string $collectorId Collector ID
* @param string $collectorId Message ID
* @return array Result
*/
public function getMessageRecipients($collectorId, $messageId){}
```

**getRecipient**
```
/**
* Gets recipient info, given a collector id and recipient id
* @see https://developer.surveymonkey.com/api/v3/#collectors-id-recipients-id
* @param string $collectorId Collector ID
* @param string $recipientId Recipient ID
* @return array Result
*/
public function getRecipient($collectorId, $recipientId){}
```

API version
-----------
v3
Expand Down
24 changes: 24 additions & 0 deletions lib/SurveyMonkey.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,30 @@ public function getCollectorList($surveyId, $params = array())
{
return $this->run('surveys/' . $surveyId . '/collectors', $params, 'GET');
}

/**
* Gets recipient summaries for all recipients of a message
* @see https://developer.surveymonkey.com/api/v3/#collectors-id-messages-id-recipients
* @param string $collectorId Collector ID
* @param string $collectorId Message ID
* @return array Result
*/
public function getMessageRecipients($collectorId, $messageId)
{
return $this->run("collectors/$collectorId/messages/$messageId/recipients", array(), "GET");
}

/**
* Gets recipient info, given a collector id and recipient id
* @see https://developer.surveymonkey.com/api/v3/#collectors-id-recipients-id
* @param string $collectorId Collector ID
* @param string $recipientId Recipient ID
* @return array Result
*/
public function getRecipient($collectorId, $recipientId)
{
return $this->run("collectors/$collectorId/recipients/$recipientId", array(), "GET");
}
}

/**
Expand Down