| @@ 62-71 (lines=10) @@ | ||
| 59 | * @param array $params Optional Parameters. |
|
| 60 | * @return \SevenShores\Hubspot\Http\Response |
|
| 61 | */ |
|
| 62 | function create($name, $params = []) |
|
| 63 | { |
|
| 64 | $endpoint = 'https://api.hubapi.com/blogs/v3/topics'; |
|
| 65 | ||
| 66 | $params['name'] = $name; |
|
| 67 | ||
| 68 | $options['json'] = $params; |
|
| 69 | ||
| 70 | return $this->client->request('post', $endpoint, $options); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * Update a blog topic. |
|
| @@ 170-180 (lines=11) @@ | ||
| 167 | * @param array $emails |
|
| 168 | * @return \SevenShores\Hubspot\Http\Response |
|
| 169 | */ |
|
| 170 | function addContact($list_id, $contact_ids, $emails = []) |
|
| 171 | { |
|
| 172 | $endpoint = "https://api.hubapi.com/contacts/v1/lists/{$list_id}/add"; |
|
| 173 | ||
| 174 | $options['json'] = [ |
|
| 175 | 'vids' => $contact_ids, |
|
| 176 | 'emails' => $emails, |
|
| 177 | ]; |
|
| 178 | ||
| 179 | return $this->client->request('post', $endpoint, $options); |
|
| 180 | } |
|
| 181 | ||
| 182 | /** |
|
| 183 | * Remove a contact from a list. |
|
| @@ 189-196 (lines=8) @@ | ||
| 186 | * @param array $contact_ids |
|
| 187 | * @return \SevenShores\Hubspot\Http\Response |
|
| 188 | */ |
|
| 189 | function removeContact($list_id, $contact_ids) |
|
| 190 | { |
|
| 191 | $endpoint = "https://api.hubapi.com/contacts/v1/lists/{$list_id}/remove"; |
|
| 192 | ||
| 193 | $options['json'] = ['vids' => $contact_ids]; |
|
| 194 | ||
| 195 | return $this->client->request('post', $endpoint, $options); |
|
| 196 | } |
|
| 197 | ||
| 198 | } |
|
| 199 | ||
| @@ 140-150 (lines=11) @@ | ||
| 137 | * @param int $parent_folder_id |
|
| 138 | * @return \SevenShores\Hubspot\Http\Response |
|
| 139 | */ |
|
| 140 | function createFolder($folder_name, $parent_folder_id) |
|
| 141 | { |
|
| 142 | $endpoint = "https://api.hubapi.com/filemanager/api/v2/folders"; |
|
| 143 | ||
| 144 | $options['json'] = [ |
|
| 145 | 'name' => $folder_name, |
|
| 146 | 'parent_folder_id' => $parent_folder_id, |
|
| 147 | ]; |
|
| 148 | ||
| 149 | return $this->client->request('post', $endpoint, $options); |
|
| 150 | } |
|
| 151 | ||
| 152 | /** |
|
| 153 | * List folders metadata. |
|
| @@ 52-62 (lines=11) @@ | ||
| 49 | * @param array $metadata The engagement metadata to update. |
|
| 50 | * @return \SevenShores\Hubspot\Http\Response |
|
| 51 | */ |
|
| 52 | function update($id, $engagement, $metadata) |
|
| 53 | { |
|
| 54 | $endpoint = "https://api.hubapi.com/engagements/v1/engagements/{$id}"; |
|
| 55 | ||
| 56 | $options['json'] = [ |
|
| 57 | 'engagement' => $engagement, |
|
| 58 | 'metadata' => $metadata, |
|
| 59 | ]; |
|
| 60 | ||
| 61 | return $this->client->request('put', $endpoint, $options); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * @param int $id |
|