Posting to this endpoint https://graph.microsoft.com/beta/me/contacts with this payload:
{
"displayName": "test",
"givenName": "test",
"emailAddresses": {
"address": "test#test.com",
"name": "test"
}
}
Results in an error:
Property emailAddresses in payload has a value that does not schema
As far as I can tell this is correct according to the emailAddress resource type https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/emailaddress
clearly I'm doing it wrong, but I don't know what needed to be changed.
Your JSON syntax is off. emailAddresses is a collection, so you need square parentheses. Try something like:
{
{
"displayName": "test",
"givenName": "test",
"emailAddresses": [
{
"address": "test#test.com",
"name": "test"
}
]
}
}
Hope this helps,
Related
Sample Data : {
"_id": "5c53d41e80e3f817d9cec5b0",
"index": 0,
"account_number": 1623,
"balance": 22526.72,
"firstname": "Desiree",
"lastname": "Mays",
"age": 46,
"gender": "female",
"address": "931 Metropolitan Avenue, Faxon, Oregon, 3046",
"employer": "IDEGO",
"email": "desireemays#idego.com",
"city": "Rodanthe",
"state": "Tennessee"
}
Conf File:
input {
file {
type => "json"
path=>'path'
}}filter { json {source => "message"} mutate {add_field => { "field_name" => "%{Firstname}" "%{lastname}"}}}output {
file {
path =>'path'
}}
I Keep on getting the tag _jsonparsefailure
Could you confirm if the input file is a JSON type and if the path is set appropriately? otherwise i don't see an anomaly with add_field syntax here.
I have some code that was working just fine a few months ago, but something in the Graph API has changed and this no longer works. I am trying to create a message in an existing folder, by doing a POST to this url:
https://graph.microsoft.com/v1.0/users/jjones#transend.onmicrosoft.com/mailFolders/AAMkADNjAAA=/messages
(folder id shortened)
The call fails with http error 400, and the returned error is "UnableToDeserializePostBody". The input json is shown below. By experimentation I was able to trace the problem specifically to "singleValueExtendedProperties". I normally put several properties there, but for this test I removed all but the one you see. I have tried other properties as well, they all fail. This seems like some stupid formatting error but I can't see it. Any help appreciated.
{
"subject": "Test again",
"Sender": {
"emailAddress": {
"name": "John Doe",
"address": "missing#domain.com"
}
},
"body": {
"contentType": "TEXT",
"content": "This is a text message."
},
"toRecipients": [
{
"emailAddress": {
"name": "Jane Smith",
"address": "missing#domain.com"
}
}
],
"ccRecipients": [
{
"emailAddress": {
"name": "Bob Jones",
"address": "missing#domain.com"
}
}
],
"singleValueExtendedProperties": [
{
"propertyId": "SystemTime 0x0039",
"value": "1998-07-29T21:30:00.0000+00:00"
}
],
"importance": "normal"
}
The main problem here is you are specifying the property('propertyid') in singleValueExtendedProperties object is not valid. There are only 2 properties in singleValueExtendedProperties. One is id and the other is value.
Replace 'propertyId' with id.
I have tested it in POSTMAN with your payload changing the propertyId to id and it worked.
Request Body:-
{
"subject": "Test again",
"Sender": {
"emailAddress": {
"name": "John Doe",
"address": "missing#domain.com"
}
},
"body": {
"contentType": "TEXT",
"content": "This is a text message."
},
"toRecipients": [
{
"emailAddress": {
"name": "Jane Smith",
"address": "missing#domain.com"
}
}
],
"ccRecipients": [
{
"emailAddress": {
"name": "Bob Jones",
"address": "missing#domain.com"
}
}
],
"singleValueExtendedProperties": [
{
"id": "SystemTime 0x0039",
"value": "1998-07-29T21:30:00.0000+00:00"
}
],
"importance": "normal"
}
I'm using swagger 2.0 and I have the following schema(definition) :
"User": {
"type": "object",
"properties": {
"firstName": {
"type": "string",
"example": "Tom"
},
"lastName": {
"type": "string",
"example": "Hanks"
},
"email": {
"type": "string",
"example": "Tom.Hanks#gmail.com"
},
"password": {
"type": "string",
"example": "azerty#123456"
}
}
and i want to refer to this schema in one of my responses, so i do the following:
"responses": {
"201": {
"description": "Created.",
"schema": {
"$ref": "#/definitions/User"
}
}
}
Until now everything works perfectly, but i don't want to expose the password property in the response schema. is the anyway to choose exactly the properties i want to use from the Userdefinition ?
No, there is no way. I'd suggest you define 2 types:
One type for user data without password, let's name it User.
And another type that inherits from it and contains additionally a password attribute. Let's name it UserWithCredential.
I am trying to create a ticket in JIRA by following https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/request-createCustomerRequest
I send a post request to https:/x.atlassian.net//rest/servicedeskapi/servicedesk/request
With following json param
{
"serviceDeskId": “1”,
"requestTypeId": “1”,
"requestFieldValues": {
"summary": "Request raised via service REST API",
"description": "test."
}
}
But it replied with 404 error
{
"errorMessage": "Invalid project key 'request'",
"i18nErrorMessage": {
"i18nKey": "sd.error.project.by.key.not.found",
"parameters": [
"request"
]
}
}
Update - the service desk id and request type id got from a response of rest/servicedeskapi/request/{issueid}. Therefore values used for service desk id request type id can not be wrong
I tried servicedesk/1/requesttype/1/field and I received
{
"requestTypeFields": [
{
"fieldId": "summary",
"name": "Subject",
"description": "",
"required": true,
"defaultValues": [],
"validValues": [],
"jiraSchema": {
"type": "string",
"system": "summary"
}
},
{
"fieldId": "description",
"name": "Body",
"description": "",
"required": false,
"defaultValues": [],
"validValues": [],
"jiraSchema": {
"type": "string",
"system": "description"
}
}
],
"canRaiseOnBehalfOf": true,
"canAddRequestParticipants": true
}
I am not able to understand what am I missing. Can someone please advice
Issue was with the url. There is an unnecessary 'servicedesk' in the url.
After removing that it worked.
https:/x.atlassian.net//rest/servicedeskapi/request
I'm using Fiddler to create a new thread to my conversation and I'm following the documentation here and I'm getting this error:
message="Posts" property missing in create conversation request body.
What's really weird is that I'm using the exact request model from the documentation.
POST https://graph.microsoft.com/v1.0/groups/<id>/conversations/<id>/threads
Content-type: application/json
Content-length: 419
{
"toRecipients": [
{
"emailAddress": {
"name": "name-value",
"address": "address-value"
}
}
],
"topic": "topic-value",
"hasAttachments": true,
"lastDeliveredDateTime": "datetime-value",
"uniqueSenders": [
"uniqueSenders-value"
],
"ccRecipients": [
{
"emailAddress": {
"name": "name-value",
"address": "address-value"
}
}
]
}
I understand that clearly the Posts property is missing, but where should this property placed?
Like this,
"topic": "topic-value",
"Posts": "This is a post" <<<
"hasAttachments": true,
didn't worked and threw the following error message:
"message": "Property Posts in payload has a value that does not match schema."
I'd really appreciate your input with this issue.
Many thanks in advance!
EDIT:
Added the following to the sample model and I was able to create a new thread:
"posts": [{}]
Basically I used the same model, but added a posts property and I managed to create a new thread:
{
"toRecipients": [
{
"emailAddress": {
"name": "name-value",
"address": "address-value"
}
}
],
"topic": "topic-value",
"hasAttachments": true,
"lastDeliveredDateTime": "datetime-value",
"uniqueSenders": [
"uniqueSenders-value"
],
"posts": [{}], <<<< HERE, empty post
"ccRecipients": [
{
"emailAddress": {
"name": "name-value",
"address": "address-value"
}
}
]
}
And I assume the composition of posts is:
"posts": [{
"body": {
"contentType": "html",
"content": "this is body content"
},
Hope it can help someone else in the future.