2016-06-30 13 views
0

Gmail APIでPHPのjsonデータを返す方法を教えてください。私はデータをjson_encodeしようとしましたが、データのほんの一部しかエンコードされず、残りは表示されません。 Gmail APIには、返り値の型を変更するために 'alt'パラメータを使用できますが、ドキュメントで提供されているget関数にどのように含めるかはわかりません。Gmail APIからJSONデータを取得するにはどうすればよいですか?

function getMessage($service, $userId, $messageId) { 
     try { 
      $message = $service->users_messages->get($userId, $messageId); 
      print 'Message with ID: ' . $message->getId() . ' retrieved.'; 
      return $message; 
     } catch (Exception $e) { 
      print 'An error occurred: ' . $e->getMessage(); 
     } 
    } 

アレイ結果は:

Google_Service_Gmail_Message Object ([collection_key:protected] => labelIds [internal_gapi_mappings:protected] => Array () [historyId] 
=> 1785321 [id] => 1559c18decd5dd2f [internalDate] => 1467202684000 [labelIds] => Array ([0] => INBOX [1] => CATEGORY_PERSONAL) [payloadType:protected] => Google_Service_Gmail_MessagePart [payloadDataType:protected] => [raw] => [sizeEstimate] => 64367 [snippet] => From: "United Airlines, Inc. " <[email protected]> Date: June 28, 2016 at 11: [threadId] => 1559c18decd5dd2f [modelData:protected] => Array ([payload] => Array ([mimeType] => multipart/alternative [filename] => [headers] => Array ([0] => Array ([name] => Delivered-To [value] => [email protected]) [1] => Array ([name] => Received [value] 
=> by 10.55.141.70 with SMTP id p67csp1194499qkd; Wed, 29 Jun 2016 05:18:43 -0700 (PDT)) [2] => Array ([name] => X-Received [value] => by 10.157.0.41 with SMTP id 38mr5226713ota.81.1467202723587; Wed, 29 Jun 2016 05:18:43 -0700 (PDT)) [3] => Array ([name] => Return-Path [value] =>) [4] => Array ([name] => Received [value] => from BAY004-OMC3S3.hotmail.com (bay004-omc3s3.hotmail.com. [65.54.190.141]) by mx.google.com with ESMTPS id h22si2854830otd.57.2016.06.29.05.18.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jun 2016 05:18:43 -0700 (PDT)) [5] => Array ([name] => Received-SPF [value] => pass (google.com: domain of [email protected] designates 65.54.190.141 as permitted sender) client-ip=65.54.190.141;) [6] => Array ([name] => Authentication-Results [value] => mx.google.com; spf=pass (google.com: domain of [email protected] designates 65.54.190.141 as permitted sender) [email protected]; dmarc=pass (p=NONE dis=NONE) header.from=hotmail.com) [7] => Array ([name] => Received [value] => from BAY407-EAS15 ([65.54.190.189]) by BAY004-OMC3S3.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 29 Jun 2016 05:18:06 -0700) [8] => Array ([name] => X-TMN [value] => [qVu+KA1HzBjVEnm8pt4D52R4whDEnRzF]) [9] => Array ([name] => X-Originating-Email [value] => [[email protected]]) [10] => Array ([name] => Message-ID [value] =>) [11] => Array ([name] => Return-Path [value] => [email protected]) [12] => Array ([name] 
=> Content-Type [value] => multipart/alternative; boundary="Apple-Mail-7E50522D-FBB8-497E-AF1E-D257FAB1BB30") [13] => Array ([name] => Content-Transfer-Encoding [value] => 7bit) [14] => Array ([name] => From [value] => Sudhakar Garlanka) [15] => Array ([name] => MIME-Version [value] => 1.0 (1.0)) [16] => Array ([name] 
=> Date [value] => Wed, 29 Jun 2016 08:18:04 -0400) [17] => Array ([name] => Subject [value] => My Chicago trip) [18] => Array ([name] 
=> To [value] => Madhu Garlanka , Madhu Garlanka , Sujay Garlanka) [19] => Array ([name] => X-OriginalArrivalTime [value] => 29 Jun 2016 12:18:06.0148 (UTC) FILETIME=[4A752840:01D1D200])) [body] => Array ([size] => 0) [parts] => Array ([0] => Array ([partId] => 0 [mimeType] => text/plain [filename] => [headers] => Array ([0] => Array ([name] => Content-Type [value] => text/plain; charset="utf-8") [1] => Array ([name] => Content-Transfer-Encoding [value] => base64)) [body] => Array ([size] => 3307 [data] => DQoNCj4gRnJvbTogIlVuaXRlZCBBaXJsaW5lcywgSW5jLiAiIDx1bml0ZWRhaXJsaW5lc0B1bml0ZWQuY29tPg0KPiBEYXRlOiBKdW5lIDI4LCAyMDE2IGF0IDExOjI5OjUwIFBNIEVEVA0KPiBUbz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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCSAJIA0KPiAgDQo-IENvcHlyaWdodCDCqSAyMDE2IFVuaXRlZCBBaXJsaW5lcywgSW5jLkFsbCBSaWdodHMgUmVzZXJ2ZWQNCj4gVmlldyBvdXIgUHJpdmFjeSBQb2xpY3kuDQo-IA0KPiBFLW1haWwgSW5mb3JtYXRpb24NCj4gUGxlYXNlIGRvIG5vdCByZXBseSB0byB0aGlzIG1lc3NhZ2UgdXNpbmcgdGhlICJyZXBseSIgYWRkcmVzcy4NCj4gVGhlIGluZm9ybWF0aW9uIGNvbnRhaW5lZCBpbiB0aGlzIGUtbWFpbCBpcyBpbnRlbmRlZCBmb3IgdGhlIG9yaWdpbmFsIHJlY2lwaWVudCBvbmx5Lg0KPiBVbml0ZWQgTWlsZWFnZVBsdXMNCj4gOTAwIEdyYW5kIFBsYXphIERyLg0KPiBIb3VzdG9uLCBUWCA3NzA2NyBVU0ENCg==)) [1] => Array ([partId] => 1 [mimeType] => text/html [filename] => [headers] => Array ([0] => Array ([name] => Content-Type [value] => text/html; charset="utf-8") [1] => Array ([name] => Content-Transfer-Encoding [value] => base64)) [body] => Array ([size] => 42158 [data] => PGh0bWw-PGhlYWQ-PG1ldGEgaHR0cC1lcXVpdj0i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EgaHJlZj0ibWFpbHRvOlVuaXRlZEFpcmxpbmVzQG5ld3MudW5pdGVkLmNvbSI-VW5pdGVkQWlybGluZXNAbmV3cy51bml0ZWQuY29tPC9hPiB0byB5b3VyIGFkZHJlc3MgYm9vay4gPGEgaHJlZj0iaHR0cDovL3d3dy51bml0ZWQuY29tL3NhZmVsaXN0IiBzdHlsZT0iY29sb3I6ICM2NjY7IHRleHQtZGVjb3JhdGlvbjp1bmRlcmxpbmU7IiB0YXJnZXQ9Il9ibGFuayI-U2VlIGluc3RydWN0aW9uczwvYT4uPC9wPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHI-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBzdHlsZT0iYmFja2dyb3VuZC1pbWFnZTogbGluZWFyLWdyYWRpZW50KDBkZWcsIzIxNzJiYSAwJSwjMWI0ODg5IDEwMCUpO2JhY2tncm91bmQtY29sb3I6ICMyMTcyYmE7IiBiZ2NvbG9yPSIjMjE3MmJhIiB2YWxpZ249InRvcCI-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8IS0tW2lmIChndGUgbXNvIDkpfChJRSldPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIHdpZHRoPSI2MDAiIGNlbGxwYWRkaW5nPSIwIiBjZWxsc3BhY2luZz0iMCIgYm9yZGVyPSIwIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHI-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwhW2VuZGlmXS0tPg0KDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGFibGUgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiBib3JkZXI9IjAiIGhlaWdodD0iMzYiIHdpZHRoPSI2MDBweCIgY2xhc3M9InRhYmxlIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGJvZHk-PHRyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgc3R5bGU9InBhZGRpbmc6IDIwcHg7Ij4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIGNlbGxwYWRkaW5nPSIwIiBjZWxsc3BhY2luZz0iMCIgYm9yZGVyPSIwIiBoZWlnaHQ9IjM2IiB3aWR0aD0iMTAwJSIgY2xhc3M9InRhYmxlIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRib2R5Pjx0cj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBhbGlnbj0ibGVmdCIgc3R5bGU9IndpZHRoOjM4MHB4IiBjbGFzcz0iY2VsbCI-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgaHJlZj0iL3VhbC8iPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW1nIGJvcmRlcj0iMCIgc3JjPSJodHRwczovL3d3dy51bml0ZWQuY29tL3VhbC9Gb3JtYXQvaW1nL2VtYWlsL2xvZ29zL3VuaXRlZC1sb2dvLXdoaXRlLnBuZyIgYWx0PSJVbml0ZWQgbG9nbyIgY2xhc3M9ImltYWdlLWZpeCI-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9hPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBhbGlnbj0icmlnaHQiIHZhbGlnbj0ibWlkZGxlIiBjbGFzcz0iY2VsbCI-IA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEycHg7IGZvbnQtZmFtaWx5OiBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmOyBsaW5lLWhlaWdodDogMThweDsgY29sb3I6ICNmZmY7Ij5UdWVzZGF5LCBKdW5lIDI4LCAyMDE2PC9zcGFuPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PjwvdGFibGU-DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT48L3RhYmxlPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPCEtLVtpZiAoZ3RlIG1zbyA5KXwoSUUpXT4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90YWJsZT4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPCFbZW5kaWZdLS0-DQoNCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI-DQogICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5Pg0KICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPg0KICAgICAgICAgICAgICAgICAgIA0KCQkJCQkNCg0KPHRhYmxlIGNlbGxzcGFjaW5nPSIwIiBjZWxscGFkZGluZz0iMCIgY2xhc3M9InRhYmxlIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsgbWFyZ2luOiAwIDEwcHg7IHBhZGRpbmc6IDAgMTBweDsgYm9yZGVyLXJpZ2h0OiAxcHggc29saWQgIzk5OTsgYm9yZGVyLWxlZnQ6IDFweCBzb2xpZCAjOTk5OyBmb250LWZhbWlseTogQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZjsiPg0KICAgIDx0Ym9keT4NCiAgICAgICAgPHRyPg0KICAgICAgICAgICAgPHRkIGNvbHNwYW49IjUiIGNsYXNzPSJjZWxsIj4NCiAgICAgICAgICAgICAgICAgICAgPGgxIHN0eWxlPSJmb250LXNpemU6IDI2cHg7IGNvbG9yOiAjMDAzMDU3OyBmb250LXdlaWdodDogNDAwOyBtYXJnaW46IDIwcHggMTBweDsgcGFkZGluZzogMCI-DQogICAgICAgICAgICAgICAgICAgICAgICBGbGlnaHQgaXRpbmVyYXJ5IGZvciBzdWRoYWthciBnYXJsYW5rYQ0KICAgICAgICAgICAgICAgICAgICA8L2gxPg0KICAgICAgICAgICAgPC90ZD4NCiAgICAgICAgP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ICAgICAgICAgPHRyPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHRkPiZuYnNwOzwvdGQ-DQogICAgICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9ImNlbGwiIHN0eWxlPSJwYWRkaW5nLWJvdHRvbTogMzBweDt3aWR0aDo1MDBweDsiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIHN0eWxlPSJmb250LXNpemU6IDEycHg7IGxpbmUtaGVpZ2h0OiAxNnB4OyBjb2xvcjogIzY2NjsiPk1lc3NhZ2U6IDwvc3Bhbj4NCiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGQ-DQogICAgICAgICAgICAgICAgICAgIDwvdHI-DQogICAgICAgICAgICAgICAgPC90Ym9keT48L3RhYmxlPg0KICAgICAgICAgICAgPC90ZD4NCiAgICAgICAgPC90cj4NCg0KICAgICAgICA8dHI-DQoJPHRkIGNvbHNwYW49IjUiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmOyBwYWRkaW5nOjAgMjBweCAyMHB4IDIwcHg7dmVydGljYWwtYWxpZ246dG9wO2ZvbnQtc2l6ZTowOyIgY2xhc3M9ImNlbGwiPg0KICAgICAgICAgICAgPCEtLVtpZiAoZ3RlIG1zbyA5KXwoSUUpXT4NCiAgICAgICAgICAgIDx0YWJsZSB3aWR0aD0iMTAwJSIgYWxpZ249ImNlbnRlciIgY2VsbHBhZGRpbmc9IjAiIGNlbGxzcGFjaW5nPSIwIiBib3JkZXI9IjAiPg0KICAgICAgICAgICAgICAgIDx0cj4NCiAgICAgICAgICAgICAgICAgICAgPHRkPg0KICAgICAgICAgICAgPCFbZW5kaWZdLS0-DQogICAgICAgICAgICA8ZGl2IHN0eWxlPSJ3aWR0aDo1MCU7IGRpc3BsYXk6IGlubGluZS1ibG9jazsgdmVydGljYWwtYWxpZ246IHRvcDsiPg0KICAgICAgICAgICAgICAgIDx0YWJsZSBhbGlnbj0ibGVmdCIgd2lkdGg9IjEwMCUiIHN0eWxlPSJmb250LWZhbWlseTogQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxMnB4OyBsaW5lLWhlaWdodDogMTZweDsgY29sb3I6ICMzMzM7Ij4NCiAgICAgICAgICAgICAgICAgICAgPHRib2R5Pjx0cj4NCiAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5Db25maXJtYXRpb24gbnVtYmVyOjwvcD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cCBzdHlsZT0iZm9udC1zaXplOiA1MHB4OyBsaW5lLWhlaWdodDoxOyBwYWRkaW5nOiAyMHB4IDAgMCAwOyBtYXJnaW46IDA7Ij5NQ1dDVEI8L3A-DQogICAgICAgICAgICAgICAgICAgICAgICA8L3RkPg0KICAgICAgICAgICAgICAgICAgICA8L3RyPg0KICAgICAgICAgICAgICAgIDwvdGJvZHk-PC90YWJsZT4NCiAgICAgICAgICAgIDwvZGl2Pg0KICAgICAgICAgICAgPCEtLVtpZiAoZ3RlIG1zbyA5KXwoSUUpXT4NCiAgICAgICAgICAgIDwvdGQ-DQogICAgICAgICAgICA8dGQ-DQogICAgICAgICAgICA8IVtlbmRpZl0tLT4NCiAgICAgICAgICAgIDxkaXYgc3R5bGU9IndpZHRoOiA1MCU7IGRpc3BsYXk6IGlubGluZS1ibG9jazsgdmVydGljYWwtYWxpZ246IHRvcDsiPg0KICAgICAgICAgICAgICAgIDx0YWJsZSBhbGlnbj0icmlnaHQiIHdpZHRoPSIxMDAlIiBzdHlsZT0iZm9udC1mYW1pbHk6IEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWY7Ij4NCiAgICAgICAgICAg 

JSONエンコードされた結果である:

{ "historyId": "1785524"、 "ID": "1559c18decd5dd2f"、 "INTERNALDATE ":" 1467202684000 "、" labelIds ":[" INBOX "、" CATEGORY_PERSONAL "]、" raw ":null、" sizeEstimate ":64367、" snippet ":" From: "United Airlines、Inc."日付:June 28、 2016 at 11: "、" threadId ":" 1559c18decd5dd2f "}

+0

は 'json_decode'は' json_encode'が戻ってJSON文字列 – zanderwar

+0

にそれを回す、配列にJSON文字列を回すように見えます問題はjson_encodeはJSONでエンコードされた配列の一部だけを返し、残りは表示されません。 –

+1

あなたのJSONエンコードされた結果をあなたのJSONオブジェクト/配列のvar_dump()と共に追加できますか? – zanderwar

答えて

0

おそらくあなたはこれを使用していますか?

https://developers.google.com/gmail/api/v1/reference/users/messages/get#parameters

もしそうなら、あなたは(単一のフィールドへの完全なダンプである)フル(ペイロードフィールドに体の内容を置くように思われた)、または生のいずれかに、正しくフォーマットパラメータを設定していますか?

フルがデフォルトなので、「ペイロード」すべてのデータを持っている必要があります...

関連する問題