https://wiki.offerit.com/index.php?title=Offerit_REST_API_Edit_Advertiser&feed=atom&action=history
Offerit REST API Edit Advertiser - Revision history
2024-03-28T21:06:19Z
Revision history for this page on the wiki
MediaWiki 1.27.5
https://wiki.offerit.com/index.php?title=Offerit_REST_API_Edit_Advertiser&diff=3686&oldid=prev
Offeritnick at 21:21, 12 May 2017
2017-05-12T21:21:56Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 21:21, 12 May 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l149" >Line 149:</td>
<td colspan="2" class="diff-lineno">Line 149:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>if($output !== NULL) {</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>if($output !== NULL) {</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> //json was valid. Dump the decoded array</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> //json was valid. Dump the decoded array</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del class="diffchange diffchange-inline">var_dump</del>($output);</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins class="diffchange diffchange-inline">print_r</ins>($output);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>else {</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>else {</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> //invalid json, just dump the raw response</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> //invalid json, just dump the raw response</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del class="diffchange diffchange-inline">var_dump</del>($resp);</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins class="diffchange diffchange-inline">print_r</ins>($resp);</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>// Close request to clear up some resources</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>// Close request to clear up some resources</div></td></tr>
</table>
Offeritnick
https://wiki.offerit.com/index.php?title=Offerit_REST_API_Edit_Advertiser&diff=3681&oldid=prev
Offeritnick: /* Example Code */
2017-05-12T21:09:48Z
<p><span dir="auto"><span class="autocomment">Example Code</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 21:09, 12 May 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l145" >Line 145:</td>
<td colspan="2" class="diff-lineno">Line 145:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>$resp = curl_exec($curl);</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>$resp = curl_exec($curl);</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>//dumps an associative array representation of the json</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>//dumps an associative array representation of the json <ins class="diffchange diffchange-inline">response</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">var_dump(</del>json_decode($resp, true));</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">$output = </ins>json_decode($resp, true)<ins class="diffchange diffchange-inline">;</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">if($output !== NULL) {</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> //json was valid. Dump the decoded array</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> var_dump($output</ins>);</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">else {</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> //invalid json, just dump the raw response</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> var_dump($resp);</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>// Close request to clear up some resources</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>// Close request to clear up some resources</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>curl_close($curl);</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>curl_close($curl);</div></td></tr>
</table>
Offeritnick
https://wiki.offerit.com/index.php?title=Offerit_REST_API_Edit_Advertiser&diff=3660&oldid=prev
Offeritnick: Created page with "{{Offerit Manual | show_rest_api_section = true }} == '''PATCH /advertiser/edit_advertiser ''' == '''Description''' *edit_advertiser edits an existing advertiser account..."
2017-05-12T00:15:22Z
<p>Created page with "{{Offerit Manual | show_rest_api_section = true }} == '''PATCH /advertiser/edit_advertiser ''' == '''Description''' *edit_advertiser edits an existing advertiser account..."</p>
<p><b>New page</b></p><div>{{Offerit Manual<br />
| show_rest_api_section = true<br />
}}<br />
== '''PATCH /advertiser/edit_advertiser ''' ==<br />
'''Description''' <br />
*edit_advertiser edits an existing advertiser account<br />
<br />
<br />
'''Resource URL'''<br />
*<nowiki>http://domain/api/advertiser/edit_advertiser</nowiki><br />
*Replace domain with the Offerit domain<br />
<br />
'''Response Format'''<br />
*JSON<br />
<br />
'''[[Offerit_REST_API_Overview#Allowed_HTTP_Request_Methods|Request Method''']]<br />
*PATCH<br />
<br />
'''[[Offerit_REST_API_Overview#Authentication|Authentication]]'''<br />
*HTTP headers<br />
<br />
== '''Parameters''' ==<br />
<br />
'''''Paremeters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded'''<br />
*loginid<br />
**'''''type: string'''''<br />
**'''''required'''''<br />
**Id of affiliate to edit<br />
*password<br />
**'''''type: string'''''<br />
**Affiliate Password<br />
*email<br />
**'''''type: string'''''<br />
**'''''required'''''<br />
**'''''unique'''''<br />
**Email address for this advertiser<br />
*firstname<br />
**'''''type: string'''''<br />
*lastname<br />
**'''''type: string'''''<br />
*company<br />
**'''''type: string'''''<br />
*url<br />
**'''''type: string'''''<br />
*tel<br />
**'''''type: string'''''<br />
*icq<br />
**'''''type: string'''''<br />
*aim<br />
**'''''type: string'''''<br />
*msn<br />
**'''''type: string'''''<br />
*address1<br />
**'''''type: string'''''<br />
*address2<br />
**'''''type: string'''''<br />
*city<br />
**'''''type: string'''''<br />
*state<br />
**'''''type: string'''''<br />
*country<br />
**'''''type: string'''''<br />
*zip_code<br />
**'''''type: string'''''<br />
<br />
*join_ip<br />
**'''''type: string'''''<br />
<br />
== '''Example Request''' ==<br />
<br />
'''PATCH'''<br />
<pre><br />
<nowiki><br />
http://domain/api/advertiser/edit_advertiser<br />
loginid = 4002<br />
password = apitest<br />
firstname = hello<br />
lastname = test<br />
email = hello@offerit.com<br />
company = Offerit<br />
url = offerit.com<br />
tel = 666-666-6666<br />
icq = 666666666<br />
aim = sixsixsix<br />
msn = sixsixtysix<br />
address1 = 666 666 st<br />
address2 = <br />
city = My City<br />
state = My State<br />
country = USA<br />
zip_code = 12345<br />
<br />
<br />
</nowiki><br />
</pre><br />
*Response: <br />
<pre><br />
[<br />
{<br />
"result":"Success","<br />
}<br />
]<br />
</pre><br />
<br />
== '''Example Code''' ==<br />
<br />
'''PHP'''<br />
<pre><br />
<?php<br />
$curl = curl_init();<br />
<br />
$url = 'http://domain/api/advertiser/edit_advertiser';<br />
<br />
$headers = array(<br />
'api-key: 44b5498dbcb481a0d00b404c0169af62',<br />
'api-username: productsupport'<br />
);<br />
<br />
$data = array(<br />
'loginid' => 4002,<br />
'password' => 'apitest',<br />
'firstname' => 'hello',<br />
'lastname' => 'test',<br />
'email' => 'hello3@offerit.com',<br />
'company' => 'Offerit',<br />
'url' => 'offerit.com',<br />
'tel' => '666-666-6666',<br />
'icq' => '666666666',<br />
'aim' => 'sixsixsix',<br />
'msn' => 'sixsixtysix',<br />
'address1' => '666 666 st',<br />
'address2' => '',<br />
'city' => 'My City',<br />
'state' => 'My State',<br />
'country' => 'USA',<br />
'zip_code' => '12345',<br />
'join_ip' => '192.168.1.1',<br />
);<br />
<br />
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); <br />
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); <br />
curl_setopt($curl, CURLOPT_URL, $url);<br />
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PATCH");<br />
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); <br />
<br />
$resp = curl_exec($curl);<br />
//dumps an associative array representation of the json<br />
var_dump(json_decode($resp, true));<br />
// Close request to clear up some resources<br />
curl_close($curl);<br />
?><br />
<br />
<br />
</pre><br />
<br />
<br />
<br />
[[Category:Offerit API Articles]]</div>
Offeritnick