Microsoft Graph API: GET Outlook Calendar Event: Filter by Organizer Email - events

I'm trying to GET Outlook Calendar event by organizer email.
Here is the request URL I'm using:
https://graph.microsoft.com/v1.0/me/events?$filter=organizer/emailAddress/address eq 'john#gmail.com'
The request fails with this error:
501 Not Implemented: {
"error": {
"code": "UnsupportedEntityExpression",
"message": "'i => (i.Organizer.EmailAddress == \"john#gmail.com\")' is not a supported filter expression.",
"innerError": {
"request-id": "62206cba-ad9e-4051-b504-321cbcacc6fd",
"date": "2017-08-04T23:39:47"
}
}
}
FYI I'm running this request on an iPaas called Workato and this is the error message displayed on it.
What puzzles me is that this similar request works:
https://graph.microsoft.com/v1.0/me/events?$filter=organizer/emailAddress/name eq 'john doe'
Both name and address are properties of emailAddress so I'm not sure why the first request fails.
Has anyone filtered by organizer email before?

I could reproduce this error , and find a thread talking about same topic:
https://github.com/microsoftgraph/microsoft-graph-docs/issues/426
It seems a bug and hasn't been fixed currently .

Related

Google API Get event - Not Found

I am trying to to get event resource using the following api
https://www.googleapis.com/calendar/v3/calendars/primary/events/eventId.
However, I am receiving 404 Not Found response, eventId is correct, I've checked it many times. Also, I've tried to call same method from their website (https://developers.google.com/calendar/api/v3/reference/events/get) and still receiving same error. You can find the attached screenshot here.
API Response Body :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
404 Not Found means just that not found.
The event.get method takes a event id as a parameter.
The user you are authencation with needs to have permission to access that event your its going to return a 404 not found for that user.
Try doing an events.list first for the calendar to get a list of all valid events for that calendar if it also returns a 404 then the problem would be that the user does not have access to that calendar.

How to send a proactive message from a bot to a user

I am trying to send a message from a bot to a teams user who hasn't already installed the bot and doesn't need to install the bot via REST API.
I have tried following this document.
It clearly states:
"Sending a message to start a new conversation thread is different than sending a message in response to an existing conversation: when your bot starts a new a conversation, there is no pre-existing conversation to post the message to. In order to send a proactive message you need to:"
As far as I understand, this means that what I am trying to do is possible. I have tried to run this sample.
However, as far as I can tell it needs a conversation id. Without a conversation id it doesn't work.
I have tried to send a request like this with a bot network token ( which is normally used to respond to an activity request by the user):
POST /v3/conversations
{
"bot": {
"id": "28:10j12ou0d812-2o1098-c1mjojzldxcj-1098028n ",
"name": "The Bot"
},
"members": [
{
"id": "29:012d20j1cjo20211"
}
],
"channelData": {
"tenant": {
"id": "197231joe-1209j01821-012kdjoj"
}
}
}
However, it fails with the following message:
Send Message to https://graph.microsoft.com/v3/conversations failed: (401) {
"error": {
"code": "InvalidAuthenticationToken",
"message": "Access token validation failure. Invalid audience.",
"innerError": {
"request-id": "92922235-8c87-47ed-92bc-4ba17469611a",
"date": "2019-09-24T14:43:59"
}
}
}
I am guessing that this maybe because I didn't send MicrosoftAppCredentials.TrustServiceUrl first. But this is a c# call. How do I make the same call in REST API?
Please take a look at Bot Framework REST APIs documentation.
Here are steps to generate the access token which you could use to call Create Conversation APIs.
POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=MICROSOFT-APP-ID&client_secret=MICROSOFT-APP-PASSWORD&scope=https%3A%2F%2Fapi.botframework.com%2F.default

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.

Using the insert method of the Google Data Transfer API to start a transfer

I am trying to use the transfers:insert method of the Google Admin SDK Data Transfer API. I am performing this API call as the super admin account of my domain. I have verified that API access is enabled for our domain, and that the Super Admin admin role has permission to use the Data Transfer API.
I am testing this in the APIs Explorer on this page.
55656082996 is the ID string that I got for Google Drive from the applications:list APIs Explorer.
Request:
POST https://www.googleapis.com/admin/datatransfer/v1/transfers?key={YOUR_API_KEY}
{
"oldOwnerUserId": "olduser#ourdomain.com",
"newOwnerUserId": "newuser#ourdomain.com",
"applicationDataTransfers": [
{
"applicationId": "55656082996"
}
]
}
Response:
400 OK
- SHOW HEADERS -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid value for: Invalid oldOwnerUserId."
}
],
"code": 400,
"message": "Invalid value for: Invalid oldOwnerUserId."
}
}
I get the same "Invalid value for: Invalid oldOwnerUserId." response no matter if I use email addresses or usernames. I also tried excluding the applicationDataTransfers array from the response, but that also didn't work.
The documentation does not say this, but the Id cannot be the user's email address, like in all of the other Google APIs, but rather it needs to be a numeric ID for the user that you can get using the Users:get Directory API method.
I figured this out by Google searching and coming across this documentation, where they elaborate upon oldOwnerUserId by saying "# ID"
In addition to the answer above.
Here is how you can get the employee' IDs from Gsuite API in Python 3.*
def create_directory_service():
credentials = cls.get_credentials(scopes=['https://www.googleapis.com/auth/admin.directory.user'])
return build('admin', 'directory_v1', credentials=credentials, cache_discovery=Fals
service = create_directory_service()
old_owner_google_id = service.users().get(userKey=old_owner).execute()['id']
new_owner_google_id = service.users().get(userKey=new_owner).execute()['id']

Resources