From 252b7bb5f9db8ff1383cf44b5b58e6b864d04cde Mon Sep 17 00:00:00 2001 From: NKuznetsov Date: Wed, 2 Nov 2016 13:35:54 +0300 Subject: [PATCH] +getTags, getTagsByName method Added api method --- src/GetResponseAPI3.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/GetResponseAPI3.class.php b/src/GetResponseAPI3.class.php index 2782e2f..aedf32f 100644 --- a/src/GetResponseAPI3.class.php +++ b/src/GetResponseAPI3.class.php @@ -80,6 +80,24 @@ public function getCampaigns() return $this->call('campaigns'); } + public function getTags() + { + return $this->call('tags'); + } + + public function getTagsByName($tagName) + { + $tagId = ""; + $tags = (array)$this->getTags(); + $arrayTags = json_decode(json_encode($tags), True); + foreach ($arrayTags as $tag) { + if ($tag["name"] == $tagName) { + $tagId = $tag["tagId"]; + } + } + return $tagId; + } + /** * get single campaign * @param string $campaign_id retrieved using API