Title: Not able to send attachment with this API https://graph.microsoft.com/v1.0/me/sendMail · Issue #192 · microsoftgraph/msgraph-sdk-java · GitHub
Open Graph Title: Not able to send attachment with this API https://graph.microsoft.com/v1.0/me/sendMail · Issue #192 · microsoftgraph/msgraph-sdk-java
X Title: Not able to send attachment with this API https://graph.microsoft.com/v1.0/me/sendMail · Issue #192 · microsoftgraph/msgraph-sdk-java
Description: Getting 400 Bad Request with error body : "Property attachments in payload has a value that does not match schema." Trying to upload the attachment as shown below where message is initialized as Message message = new Message(); and fille...
Open Graph Description: Getting 400 Bad Request with error body : "Property attachments in payload has a value that does not match schema." Trying to upload the attachment as shown below where message is initialized as Me...
X Description: Getting 400 Bad Request with error body : "Property attachments in payload has a value that does not match schema." Trying to upload the attachment as shown below where message is initial...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java/issues/192
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Not able to send attachment with this API https://graph.microsoft.com/v1.0/me/sendMail","articleBody":"Getting 400 Bad Request with error body : \"Property attachments in payload has a value that does not match schema.\"\r\n\r\nTrying to upload the attachment as shown below where message is initialized as \r\nMessage message = new Message(); \r\nand filled other message values like subject, body etc. It is working fine without attachment upload.\r\n\r\n\r\nfinal BaseAttachmentCollectionResponse response = new BaseAttachmentCollectionResponse();\r\n try {\r\n response.value = Arrays.asList(getFileAttachment());\r\n }\r\n catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n message.attachments = new AttachmentCollectionPage(response, null);\r\n \r\n }\r\n \r\n private FileAttachment getFileAttachment() throws Exception{\r\n FileAttachment fileAttachment = new FileAttachment();\r\n fileAttachment.name = \"document.pdf\";\r\n File pdfFile = new File(\"src/main/resources/document.pdf\");\r\n InputStream fileStream = new FileInputStream(pdfFile);\r\n fileAttachment.contentBytes = getByteArray(fileStream);\r\n fileAttachment.oDataType = \"#microsoft.graph.fileAttachment\";\r\n return fileAttachment;\r\n}\r\n\r\nAPI used to send the email is : https://graph.microsoft.com/v1.0/me/sendMail\r\nI am not sure where I am doing wrong.\r\n\r\nAppreciate your help here..\r\n\r\n\r\n","author":{"url":"https://github.com/poonamsehjwani","@type":"Person","name":"poonamsehjwani"},"datePublished":"2018-12-26T11:00:01Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java/issues/192"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:722ec27e-d1da-eb55-a9b6-8a35fbe796c4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A346:3AB7CB:9FBD0:D7107:6B050A9A |
| html-safe-nonce | 0639f3c9aa8ba3e355b61488a35cec8baed5a2ffceff22df26bb6022996b122a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzQ2OjNBQjdDQjo5RkJEMDpENzEwNzo2QjA1MEE5QSIsInZpc2l0b3JfaWQiOiI2MzEwMzkxMjc1NjUyOTc1MjU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9641a03fabb908007e018e5597eac511f9225e552dc5238b6b4b26245647fc37 |
| hovercard-subject-tag | issue:394143147 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java/192/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ded565036040967be3cf8d46778b470eadb7b7602a5617a1e611cbcff6e78e53/microsoftgraph/msgraph-sdk-java/issues/192 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ded565036040967be3cf8d46778b470eadb7b7602a5617a1e611cbcff6e78e53/microsoftgraph/msgraph-sdk-java/issues/192 |
| og:image:alt | Getting 400 Bad Request with error body : "Property attachments in payload has a value that does not match schema." Trying to upload the attachment as shown below where message is initialized as Me... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | poonamsehjwani |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-java git https://github.com/microsoftgraph/msgraph-sdk-java.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 103300409 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 103300409 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width