{"action":"created","issue":{"url":"https://api.github.com/repos/Yoctol/messaging-apis/issues/334","repository_url":"https://api.github.com/repos/Yoctol/messaging-apis","labels_url":"https://api.github.com/repos/Yoctol/messaging-apis/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/Yoctol/messaging-apis/issues/334/comments","events_url":"https://api.github.com/repos/Yoctol/messaging-apis/issues/334/events","html_url":"https://github.com/Yoctol/messaging-apis/issues/334","id":314612255,"number":334,"title":"SendFile failed with buffer","user":{"login":"Calvin-Lin","id":1947599,"avatar_url":"https://avatars2.githubusercontent.com/u/1947599?v=4","gravatar_id":"","url":"https://api.github.com/users/Calvin-Lin","html_url":"https://github.com/Calvin-Lin","followers_url":"https://api.github.com/users/Calvin-Lin/followers","following_url":"https://api.github.com/users/Calvin-Lin/following{/other_user}","gists_url":"https://api.github.com/users/Calvin-Lin/gists{/gist_id}","starred_url":"https://api.github.com/users/Calvin-Lin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Calvin-Lin/subscriptions","organizations_url":"https://api.github.com/users/Calvin-Lin/orgs","repos_url":"https://api.github.com/users/Calvin-Lin/repos","events_url":"https://api.github.com/users/Calvin-Lin/events{/privacy}","received_events_url":"https://api.github.com/users/Calvin-Lin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-16T11:36:14Z","updated_at":"2018-04-16T12:41:17Z","closed_at":null,"author_association":"OWNER","body":"I tried\r\n```\r\nconst buffer = Buffer.from(<csv string>);\r\nclient.sendFile(USER_ID, buffer);\r\n```\r\nThen got error\r\n```\r\nError: Messenger API - 100 OAuthException (#100) Incorrect number of files uploaded. Must upload exactly one file.\r\n    at handleError (/Users/dvlab/Desktop/CHT-bot/node_modules/messaging-api-messenger/lib/MessengerClient.js:63:9)\r\n    at <anonymous>\r\n    at process._tickCallback (internal/process/next_tick.js:188:7)\r\n\r\nError Message -\r\n  Messenger API - 100 OAuthException (#100) Incorrect number of files uploaded. Must upload exactly one file.\r\n\r\nRequest -\r\n  POST https://graph.facebook.com/v2.11/me/messages?access_token=<access_token>\r\n\r\nRequest Data -\r\n  {\r\n    \"_overheadLength\": 474,\r\n    \"_valueLength\": 107,\r\n    \"_valuesToMeasure\": [],\r\n    \"writable\": false,\r\n    \"readable\": true,\r\n    \"dataSize\": 0,\r\n    \"maxDataSize\": 2097152,\r\n    \"pauseStreams\": true,\r\n    \"_released\": true,\r\n    \"_streams\": [],\r\n    \"_currentStream\": null,\r\n    \"_boundary\": \"--------------------------416666756942652263281922\",\r\n    \"_events\": {},\r\n    \"_eventsCount\": 0\r\n  }\r\n\r\nResponse -\r\n  400 Bad Request\r\n\r\nResponse Data -\r\n  {\r\n    \"error\": {\r\n      \"message\": \"(#100) Incorrect number of files uploaded. Must upload exactly one file.\",\r\n      \"type\": \"OAuthException\",\r\n      \"code\": 100,\r\n      \"error_subcode\": 2018005,\r\n      \"fbtrace_id\": \"EUKH++BUy3l\"\r\n    }\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/Yoctol/messaging-apis/issues/comments/381585506","html_url":"https://github.com/Yoctol/messaging-apis/issues/334#issuecomment-381585506","issue_url":"https://api.github.com/repos/Yoctol/messaging-apis/issues/334","id":381585506,"user":{"login":"chentsulin","id":3382565,"avatar_url":"https://avatars2.githubusercontent.com/u/3382565?v=4","gravatar_id":"","url":"https://api.github.com/users/chentsulin","html_url":"https://github.com/chentsulin","followers_url":"https://api.github.com/users/chentsulin/followers","following_url":"https://api.github.com/users/chentsulin/following{/other_user}","gists_url":"https://api.github.com/users/chentsulin/gists{/gist_id}","starred_url":"https://api.github.com/users/chentsulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chentsulin/subscriptions","organizations_url":"https://api.github.com/users/chentsulin/orgs","repos_url":"https://api.github.com/users/chentsulin/repos","events_url":"https://api.github.com/users/chentsulin/events{/privacy}","received_events_url":"https://api.github.com/users/chentsulin/received_events","type":"User","site_admin":false},"created_at":"2018-04-16T12:41:17Z","updated_at":"2018-04-16T12:41:17Z","author_association":"OWNER","body":"relevant issue: https://github.com/Yoctol/messaging-apis/issues/223"}}
{"actor":{"display_login":"chentsulin"}}