Skip to content

Commit 839281b

Browse files
author
Daniel Chesterton
committed
Merge pull request dchesterton#27 from anthonyptetlow/additional_api_methods
Additional API Funcitons
2 parents 1277729 + 9a54ebb commit 839281b

File tree

5 files changed

+150
-0
lines changed

5 files changed

+150
-0
lines changed

src/Client.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,61 @@ public function getLeadChanges($nextPageToken, $fields, $args = array(), $return
629629
return $this->getResult('getLeadChanges', $args, true, $returnRaw);
630630
}
631631

632+
/**
633+
* Update an editable section in an email
634+
*
635+
* @param int $emailId
636+
* @param string $htmlId
637+
* @param array $args
638+
*
639+
* @link http://developers.marketo.com/documentation/asset-api/update-email-content-by-id/
640+
*
641+
* @return Response
642+
*/
643+
public function updateEmailContent($emailId, $args = array(), $returnRaw = false)
644+
{
645+
$args['id'] = $emailId;
646+
647+
return $this->getResult('updateEmailContent', $args, false, $returnRaw);
648+
}
649+
650+
/**
651+
* Update an editable section in an email
652+
*
653+
* @param int $emailId
654+
* @param string $htmlId
655+
* @param array $args
656+
*
657+
* @link http://developers.marketo.com/documentation/asset-api/update-email-content-in-editable-section/
658+
*
659+
* @return UpdateEmailContentInEditableSectionResponse
660+
*/
661+
public function updateEmailContentInEditableSection($emailId, $htmlId, $args = array(), $returnRaw = false)
662+
{
663+
$args['id'] = $emailId;
664+
$args['htmlId'] = $htmlId;
665+
666+
return $this->getResult('updateEmailContentInEditableSection', $args, false, $returnRaw);
667+
}
668+
669+
/**
670+
* Approve an email
671+
*
672+
* @param int $emailId
673+
* @param string $htmlId
674+
* @param array $args
675+
*
676+
* @link http://developers.marketo.com/documentation/asset-api/approve-email-by-id/
677+
*
678+
* @return approveEmail
679+
*/
680+
public function approveEmail($emailId, $args = array(), $returnRaw = false)
681+
{
682+
$args['id'] = $emailId;
683+
684+
return $this->getResult('approveEmailbyId', $args, false, $returnRaw);
685+
}
686+
632687
/**
633688
* Internal helper method to actually perform command.
634689
*
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Marketo REST API Client package.
5+
*
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace CSD\Marketo\Response;
12+
13+
use CSD\Marketo\Response;
14+
15+
/**
16+
* Response for the create/update lead API methods.
17+
*
18+
*/
19+
class ApproveEmailResponse extends Response
20+
{
21+
22+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/*
3+
* This file is part of the Marketo REST API Client package.
4+
*
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/
9+
10+
namespace CSD\Marketo\Response;
11+
12+
use CSD\Marketo\Response;
13+
14+
/**
15+
* Response for the email content in editable section API method.
16+
*
17+
*/
18+
class UpdateEmailContentInEditableSectionResponse extends Response
19+
{
20+
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/*
3+
* This file is part of the Marketo REST API Client package.
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*/
8+
9+
namespace CSD\Marketo\Response;
10+
11+
use CSD\Marketo\Response;
12+
13+
/**
14+
* Response for the update email content API method.
15+
*
16+
*/
17+
class UpdateEmailContentReponse extends Response
18+
{
19+
20+
}
21+

src/service.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,37 @@
216216
"uri": "leads/partitions.json",
217217
"parameters": {},
218218
"responseClass": "CSD\\Marketo\\Response\\GetLeadPartitionsResponse"
219+
},
220+
"updateEmailContent": {
221+
"httpMethod": "POST",
222+
"uri": "/rest/asset/v1/email/{id}/content.json",
223+
"parameters": {
224+
"id": {"location": "uri"},
225+
"subject": {"location": "query"},
226+
"fromEmail": {"location": "query"},
227+
"fromName": {"location": "query"},
228+
"replyTo": {"location": "query"}
229+
},
230+
"responseClass": "CSD\\Marketo\\Response\\UpdateEmailContentReponse"
231+
},
232+
"updateEmailContentInEditableSection": {
233+
"httpMethod": "POST",
234+
"uri": "/rest/asset/v1/email/{id}/content/{htmlId}.json",
235+
"parameters": {
236+
"id": {"location": "uri"},
237+
"htmlId": {"location": "uri"},
238+
"type": {"location": "query"},
239+
"value": {"location": "query"}
240+
},
241+
"responseClass": "CSD\\Marketo\\Response\\UpdateEmailContentInEditableSectionResponse"
242+
},
243+
"approveEmailbyId": {
244+
"httpMethod": "POST",
245+
"uri": "/rest/asset/v1/email/{id}/approveDraft.json",
246+
"parameters": {
247+
"id": {"location": "uri"}
248+
},
249+
"responseClass": "CSD\\Marketo\\Response\\ApproveEmailResponse"
219250
}
220251
}
221252
}

0 commit comments

Comments
 (0)