简体   繁体   English

Mailshake API 集成到 php

[英]Mailshake API Integration in php

I am new in mail shake API integration in php.So I want to integrate mail shake using php.I read the documentation and follow git hub but not found the way "how to integrate?".Please assist me. I am new in mail shake API integration in php.So I want to integrate mail shake using php.I read the documentation and follow git hub but not found the way "how to integrate?".Please assist me.

You can easily do it with CURL, here i have placed sample code with CURL您可以使用 CURL 轻松完成此操作,这里我已使用 CURL 放置示例代码

curl "https://api.mailshake.com/2017-04-01/recipients/add" \
  -u "my-api-key:" \
  -d campaignID=1 \
  -d addAsNewList=true \
  -d listOfEmails="\"John Doe\" <john@doe.com>, \"Jane Doe\" <jane@doe.com>"

You can try this one.你可以试试这个。

<pre>
    &lt;?php
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://api.mailshake.com/2017-04-01/recipients/add? 
        campaignID=1&addAsNewList=true&listOfEmails=bikash%40cleonix.net",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "GET",
        CURLOPT_HTTPHEADER => array(
            "cache-control: no-cache",
            "my-api-key: 0ea58c25-389f-427b-9e72-50a58b8319e7"   
        ),
    ));
    $response = curl_exec($curl);
    $err = curl_error($curl);
    curl_close($curl);
    if ($err) {
        echo "cURL Error #:" . $err;
    } else {
        echo $response;
    }
</pre>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM