我的主要目標是將用戶添加到列表中。目前我正在用curl來處理使用MailChimp API的概念。Mailchimp API v3授權
我所做的請求將用戶添加到列表:
curl -i -H "Content-Type: application/json" -d '{"apikey" : "60dd1f3aaa977bf1zzza159yyye93exx-us11","email_address": "[email protected]","status":"subscribed","merge_fields":{"FNAME":"Urist","LNAME":"McVankab"}}' https://us11.api.mailchimp.com/3.0/lists/ant6308990/members/
這要求退貨:
HTTP/1.1 401 Unauthorized
Server: nginx
Content-Type: application/problem+json; charset=utf-8
Content-Length: 210
Link:<https://us11.api.mailchimp.com/schema/3.0/ProblemDetailDocument.json>; rel="describedBy"
Date: Fri, 14 Aug 2015 17:22:05 GMT
Connection: close
{"type":"http://kb.mailchimp.com/api/error-docs/401-api-key-missing","title":"API Key Missing","status":401,"detail":"Your request did not include an API key.","instance":"17eb4090-13e4-47ff-aee1-ca62281fe547"}
我想知道如何獲得授權。試圖閱讀API文檔 - 簡短了。有誰知道如何設計授權請求?
謝謝。
沒得到什麼193105是基本代碼。另外你忘了'\',因爲你在curl命令中使用了linebreaks。 – Adam
是的,你是對的。這是我的錯誤,請刪除193105。 – Janaki