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

Added tags methods #14

Open
wants to merge 6 commits 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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@ List old web forms
```php
$result = $getresponse->getWebForms();
```
--
List all tags
```php
$result = $getresponse->getTags();
```

Add a tag
```php
$result = $getresponse->addTag([
'name' => 'yourtagname'
]);
```

Update a tag
```php
$result = $getresponse->updateTag($tag_id, [
'name' => 'yourtagname'
]);
```

Delete a tag
```php
$result = $getresponse->deleteTag($tag_id);
```



58 changes: 58 additions & 0 deletions src/GetResponseAPI3.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,64 @@ public function getForms($params = array())
return $this->call('forms?' . $this->setParams($params));
}

/**
* retrieve all tags
* @param array $params
*
* @return mixed
*/
public function getTags($params = array())
{
return $this->call('tags?' . $this->setParams($params));
}

/**
* retrieve specific tag
*
* @param $id
* @param array $params
* @return mixed
*/
public function getTag($id, $params = array())
{
return $this->call('tags/' . $id . '?' . $this->setParams($params));
}

/**
* add single contact into your campaign
*
* @param $params
* @return mixed
*/
public function addTag($params)
{
return $this->call('tags', 'POST', $params);
}

/**
* updating a tag
* @param $tag_id
* @param array $params
*
* @return mixed
*/
public function updateTag($tag_id, $params = array())
{
return $this->call('tags/' . $tag_id, 'POST', $params);
}

/**
* add single contact into your campaign
*
* @param $tag_id
* @param $params
* @return mixed
*/
public function deleteTag($tag_id, $params = array())
{
return $this->call('tags/' . $tag_id, 'DELETE', $params);
}

/**
* Curl run request
*
Expand Down