Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "422 Unprocessable Entity" for JSON (.json) attachment #145

Open
cdokolas opened this issue Jun 16, 2017 · 0 comments
Open

Getting "422 Unprocessable Entity" for JSON (.json) attachment #145

cdokolas opened this issue Jun 16, 2017 · 0 comments
Assignees

Comments

@cdokolas
Copy link

cdokolas commented Jun 16, 2017

I'm attaching a .json file (named "data.json") with type application/json via File.Create<Attachment>(byte[], string) and getting this response when sending the transmission:

Response: 422 Unprocessable Entity. Content: { "errors": [ { "message": "invalid data format\/type", "description": "field 'content.attachments[0].type' is of type 'json_array', but needs to be of type 'string'", "code": "1300" } ] }.

JSON part:

{
  "errors": [{
      "message": "invalid data format/type",
      "description": "field 'content.attachments[0].type' is of type 'json_array', but needs to be of type 'string'",
      "code": "1300"
    }
  ]
}

Note: I'm explicitly setting the type to application/json because MimeMapping.GetMimeMapping doesn't recognize the .json file extension.

@darrencauthon darrencauthon self-assigned this Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants