質問編集履歴

2

コードの間違いとエラーメッセージを修正しました

2020/12/16 03:45

投稿

naga777
naga777

スコア7

test CHANGED
File without changes
test CHANGED
@@ -24,15 +24,21 @@
24
24
 
25
25
 
26
26
 
27
- Fatal error: Uncaught Error: Call to a member function addListMember() on null in /Applications/MAMP/htdocs/test2/test.php:14
27
+ Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://us7.api.mailchimp.com/3.0/lists` resulted in a `403 Forbidden` response:
28
+
29
+ {"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"User action not permitt (truncated...)
30
+
31
+ in /Applications/MAMP/htdocs/test2/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
28
32
 
29
33
  Stack trace:
30
34
 
31
- #0 {main}
35
+ #0 /Applications/MAMP/htdocs/test2/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
32
36
 
33
- thrown in /Applications/MAMP/htdocs/test2/test.php on line 14
37
+ #1 /Applications/MAMP/htdocs/test2/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
34
38
 
39
+ #2 /Applications/MAMP/htdocs/test2/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
35
40
 
41
+ #3 /Applications/MAMP/htdocs/test2/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promi in /Applications/MAMP/htdocs/test2/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
36
42
 
37
43
  ```
38
44
 
@@ -46,11 +52,11 @@
46
52
 
47
53
 
48
54
 
49
- $mailchimp = new \MailchimpMarketing\ApiClient();
55
+ $client = new \MailchimpMarketing\ApiClient();
50
56
 
51
57
 
52
58
 
53
- $mailchimp->setConfig([
59
+ $client->setConfig([
54
60
 
55
61
  'apiKey' => '*****************',
56
62
 

1

微修正

2020/12/16 03:45

投稿

naga777
naga777

スコア7

test CHANGED
File without changes
test CHANGED
@@ -52,7 +52,7 @@
52
52
 
53
53
  $mailchimp->setConfig([
54
54
 
55
- 'apiKey' => '86afbcd0ba96b120f882632e8dd78367-us7',
55
+ 'apiKey' => '*****************',
56
56
 
57
57
  'server' => 'YOUR_SERVER_PREFIX'
58
58
 
@@ -60,7 +60,7 @@
60
60
 
61
61
 
62
62
 
63
- $list_id = "dc10ebbd05";
63
+ $list_id = "**********";
64
64
 
65
65
 
66
66