Microsoft Teams Chat Messages Order By Query Parameter - sorting

I tried to retrieve my Ms-Teams Chat(Direct/Group) messages using Ms-Graph API along with the Query Parameter "OrderBy" to sort the response using "createdDateTime", but I faced this error.
{
"error": {
"code": "",
"message": "The query specified in the URI is not valid. Query option 'OrderBy' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.",
"innerError": {
"message": "Query option 'OrderBy' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.",
"date": "2020-08-20T07:28:36",
}
}
}
Is there any other way to retrieve my Ms-Teams Chat(Direct/Group) Message Response in an Ascending order with respect to the "createdDateTime"?

Related

How to get details of high importance mails via Graph API

I am trying to get list of mails that are with high importance via Graph API.
For that, I am using below query:
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject
But that's not working out as it is giving all :(
I found that I have to add filter in the query and tried like below:
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject &
$filter=importance eq high
But I'm getting error like below:
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Could not find a property named 'high' on type 'Microsoft.OutlookServices.Message'.",
"innerError": {
"date": "2022-06-10T04:29:52",
"request-id": "",
"client-request-id": ""
}
}
}
I think I'm using query in a wrong way. Can anyone suggest me what's wrong?
Use single quotation mark '' for the specific name of the importance
https://graph.microsoft.com/v1.0/me/messages?$select=importance,subject&$filter=importance eq 'high'

" Mandatory fields missing" error while using ServiceNow API

I am using ServiceNow API to create a Catalog request.
URL:
https://<ServiceNow>/api/sn_sc/servicecatalog/items/6e2cc01d4f51ce08d4fb2b8ca310c7a6/order_now
BODY:
{
"sysparm_quantity":"1",
"variables": {
"requestor":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Requested For":"6e2cc01d4f51ce08d4fb2b8ca310c7a6",
"Group Name":"01304c6ddbef9f0827673672399619c4",
"Group Domain":"FG",
"Rationale for Approver Only (this will not be viewed by fulfillment team)":"testing"
}
}
I got this error :
{
"error": {
"detail": "",
"message": "Mandatory Variables are required"
},
"status": "failure"
}
How can I know what are the mandatory fields?
I figured out that this ID will be used to get the mandatory variables.
https://<ServiceNow>/api/sn_sc/servicecatalog/items/<Item_ID>/variables
However, I don't find it on the service now official documentation.
It should be a scripted API.
Check the elements tab in your browser (F12 for Chrome) while you have the form opened and search for "variable_tab" there you will see all expected variables. You can figure out how the mandatory ones are calle by looking at the form.

Error while creating Sales Order with "API_SALES_ORDER_SRV"

we want to create a Sales Order with Cloud SDK (Version 1.9.2) using Virtual Data Model (A_SalesOrder) in our Java Application.
We are calling S4 OnPremise System (1709).
SalesOrder so = SalesOrder.builder()
.salesOrderType("ZKE")
.salesOrganization("DE01")
.distributionChannel("01")
.organizationDivision("00")
.build();
try {
SalesOrder salesOrder = new
SalesOrderCreateFluentHelper(so).execute(endpoint);
} ....
We are getting the following error (while executing via PostMan):
"errordetails": [
{
"code": "CX_SADL_ENTITY_SRVICE_NOT_SUPP",
"message": "The requested service is not supported by entity ~A_SALESORDER",
"propertyref": "",
"severity": "error",
"target": ""
},
{
"code": "/IWBEP/CX_MGW_MED_EXCEPTION",
"message": "An exception was raised",
"propertyref": "",
"severity": "error",
"target": ""
}
]
Can somebody give us a advise to create a Sales Order via the API?
How we can create Sales Order Items for this Sales Order in one Step?
Thanks!
Additional information OData Request Data
(Response Data not provided in ERROR_LOG):
Request-Header / Request-Body:
Apparently we received this error message because we did not include any items in the request. If you give it in your body it worked. Thank you
Can you pls share the OData request and response body and payload?
Open transaction /IWFND/ERROR_LOG, choose the error message and in the lower part of the screen, choose Request Data resp. Response Data and provide us both body and header. Make sure to omit any confidential data.

user.messages.get responding invalid ID

when attempting to test out the api explorer for user.messages: get I have been getting an invalid message ID response.
I am getting the message ID from a recent email in my inbox sent to me, and removed the <> from either ends.
response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid id value"
}
],
"code": 400,
"message": "Invalid id value"
}
}
I am a bit confused as I am using the powershell module gshell and noticed that the same messageID worked in my commands but returned invalid id value in the api explorer.
edit: if I do a inbox search for rfc822msgid:[messageID] it returns the correct message
First you have to call the users.messages.list api. It will give a list of messageids. Then we have to call users.message.get api with each messageid to fetch the mail content. You can query the mails with advanced search options provided by Gmail API.
You should not use the rfc822msgid, but the Gmail API message id. Try to list messages and use the id you get from that when getting the message.

Mailchimp API 2.0 lists/subscribe responding with error 250 List_MergeFieldRequired MMERGE4 is required

I'm attempting to use the lists/subscribe Mailchimp API 2.0 endpoint to subscribe an email to a list, but I keep getting a puzzling error. My request looks like:
{
"apikey":"myapikey-us5",
"id":"listid",
"email":{"email":"my#email.com"},
"double_optin":false,
"send_welcome":true
}
I'm sending this to https://us5.api.mailchimp.com/2.0/lists/subscribe.json and getting this response:
{
"status": "error",
"code": 250,
"name": "List_MergeFieldRequired",
"error": "MMERGE4 must be provided - Please enter a value"
}
And if I specify "merge_vars": {} I still get the same error. What am I missing here?
It means you need to provide a value for MMERGE4 merge field. How you do this depends on what type of merge field MMERGE4 is, but It would be like this:
{
"apikey":"myapikey-us5",
"id":"listid",
"email":{"email":"my#email.com"},
"double_optin":false,
"send_welcome":true,
"merge_vars": {
"MMERGE4": "something"
}
}
But you should look and see what type of data that is, otherwise you might cause issues for whomever set that up as a required field.

Resources