DrewM\MailChimp\MailChimp::put PHP Method

put() public method

Make an HTTP PUT request - for creating new items
public put ( string $method, array $args = [], integer $timeout = 10 ) : array | false
$method string URL of the API request method
$args array Assoc array of arguments (usually your data)
$timeout integer Timeout limit for request in seconds
return array | false Assoc array of API response, decoded from JSON
    public function put($method, $args = array(), $timeout = 10)
    {
        return $this->makeRequest('put', $method, $args, $timeout);
    }

Usage Example

 public function updateContent($campaignId, $html, $options = [])
 {
     $defaultOptions = compact('html');
     $options = array_merge($defaultOptions, $options);
     $response = $this->mailChimp->put("campaigns/{$campaignId}/content", $options);
     if (!$this->lastActionSucceeded()) {
         return false;
     }
     return $response;
 }
All Usage Examples Of DrewM\MailChimp\MailChimp::put