Based on my previous question, I'm trying to fetch messages from a particular folder like Deleted Items.
I am following this document to achieve the above scenario: https://learn.microsoft.com/en-us/graph/api/user-list-messages
GET https://graph.microsoft.com/v1.0/me/mailFolders/deleteditems/messages
Using the above query, I'm getting all deleted messages with a lot of information(html code) that I don't want.
I want to customize the response by retrieving only particular attributes like subject, importance, sender, sentDateTime, receiver, receivedDateTime.
I tried to query something like below using $select:
GET https://graph.microsoft.com/v1.0/me/mailFolders/deleteditems/messages?$select= subject, importance, sender, sentDateTime, receiver, receivedDateTime.
But I'm getting 400:BadRequest error like below:
{
"error": {
"code": "RequestBroker--ParseUri",
"message": "Could not find a property named 'receiver' on type 'Microsoft.OutlookServices.Message'.",
"request_id": "54f9adf-7435-5r8c-a3g6-48gx6343ac",
"date": "2022-05-24T07:35:06"
}
}
How to include receiver details along with sender details???
I tried to reproduce the same in my environment and got the same error.
As I already mentioned in the comment, there is no such attribute named 'receiver'. To resolve the error, try removing that receiver in the query and check the response.
If you want to include receiver details along with sender details, you can try including toRecipients that gives info about receiver like below as an alternative:
GET https://graph.microsoft.com/v1.0/me/mailFolders/deleteditems/messages?$select=subject,importance,sender,sentDateTime,receivedDateTime,toRecipients
Response:
UPDATE:
As #Dmitry Streblechenko mentioned, this only works when you are the only receiver of those messages. If there are multiple recipients, take a while to know MAPI properties and OutlookSpy as he suggested.
Firstly, there is no receiver property. Since the message comes from a mailbox that you explicitly connect to, wouldn't receiver be the mailbox owner? Unless the message was dragged from another mailbox in Outlook.
Note that you can always request any MAPI property in your Graph query. In your particular case, you probably want PR_RECEIVED_BY_NAME / PR_RECEIVED_BY_EMAIL_ADDRESS / PidTagReceivedRepresentingSmtpAddress MAPI properties. To retrieve PidTagReceivedRepresentingSmtpAddress property, use
?$expand=singleValueExtendedProperties($filter=id eq 'String 0x5D08')
You can see available MAPI properties as well as construct a Graph query that requests them in OutlookSpy (I am its author) - click IMessage button to see all available MAPI propetrties of a selected message or click Message (Graph) | Query Parameters | Expand.
Related
I want to read PidTag properties from a specific e-mail message via Graph API REST call.
For singleValueExtendedProperties that is no problem as each of them has a specific GUID and in the filter query parameter can easily search for id with the corresponding property.
However I can't do the same with PidTags (i.e. the PidTag PidTagAccess or as OutlookSpy would show it: PR_ACCESS) because all of those PidTags have only the following attributes:
Tag num: HEX
Tag sym: String
Type: PropertyType
Value: Int
Does anyone have an idea how I could get those PidTags from an Outlook message?
I tried to put different types of attributenames into the filter query that weren't listed in the api and didn't really expect it to work. But it's better to try something out rather than to assume it won't work.
Use the proptag format to access properties predefined by MAPI, or by a client or server, and that have not already been exposed in Microsoft Graph. These properties have property identifiers in the 0x0001-0x7fff range. You can find more information about that in the Outlook extended properties overview.
Each predefined property in MAPI has well-defined description in MSDN with a property type, description and its identifier. For example, take a look at the PidTagAccess property description where you can get the required information. In OutlookSpy you may find the same information I believe.
Identifier for PidTagAccess is 0x0FF4 and type is integer, so valid id format for singleValueExtendedProperties is '{type} {proptag}'
Query to read the property:
https://graph.microsoft.com/v1.0/me/messages/{message_id}?$expand=singleValueExtendedProperties($filter=id eq 'Integer 0x0FF4')
Since you are already using OutlookSpy (I am its author), you can build your Graph queries with any MAPI properties in OutlookSpy: click Message button in the Graph group on the OutlookSpy ribbon, click "Query Parameters", check "$expand" checkbox and click the button to the right of the edit box.
In your particular case (PR_ACCESS MAPI property), the query will be singleValueExtendedProperties($filter=id eq 'Integer 0x0FF4')
I am using an access token with ZohoCRM.modules.custom.READ.
When I send a GET request to https://www.zohoapis.com/crm/v2/Custom/search, I get the following error.
{
"code": "INVALID_MODULE",
"details": {},
"message": "the module name given seems to be invalid",
"status": "error"
}
What am I doing wrong and how do I define the module I am trying to pull data from (it is called CustomModule2)?
Figured it out...
First, needed to go to https://crm.zoho.com/crm/{org_id}/settings/modules to find the actual name of CustomModule2 which is Adresses livraison.
Then, needed to go to https://crm.zoho.com/crm/{org_id}/settings/api/modules to find the API name for Adresses livraison which is Adresses_livraison.
Finally, needed to go to https://crm.zoho.com/crm/{org_id}/settings/api/modules/CustomModule2?step=FieldsList to find the API name of the field I wanted to use as a search criteria (it was Compte].
The final query using httpie is as follows.
http GET https://www.zohoapis.com/crm/v2/Adresses_livraison/search \
Authorization:"Zoho-oauthtoken {access_token}" \
criteria=="(Compte:equals:{account_id})"
Zoho is up there in the most awkward developer experiences I have encountered.
Just an update for anyone still looking into this, because I noticed that the links aren't always the same, depending on whether it's a sandbox or not, etc. So the steps are:
Go to your CRM page/dashboard and click on the Settings (cogwheel icon) on the top-right, next to your account image.
A bunch of items in panel boxes open. In the panel named "Developer Space" choose APIs
There it opens a bunch of tabs and sub-tabs and a Dashboard (As shown on the image below). The "Dashboard" sub-tab should be selected, all you have to do is switch to the sub-tab "API-Names"
I am trying to get all channels associated with a specific team so that my bot can send proactive messages. Based on the reading I've done, I need to use the FetchChannelList method in the Microsoft.Bot.Connector.Teams namespace, in the TeamsOperationsExtensions class.
If I do this:
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
ConversationList channels = connector.GetTeamsConnectorClient().Teams.FetchChannelList(activity.GetChannelData<TeamsChannelData>().Team.Id);
channels is null. If I break it down to only connector.GetTeamsConnectorClient(), that is not null, but connector.GetTeamsConnectorClient().Teams.FetchChannelList(activity.GetChannelData().Team.Id) is.
To break it down further, I tried to get activity.GetChannelData(). Only the Tenant property is not null. All the others (Channel, Team, EventType and Notification) are null.
I am using tunnelrelay, which forwards messages sent to the bot's public endpoint to a private endpoint, and am using tenant filter authentication in the messages controller. Not sure if that would cause any problems? (When I watch messages coming in through tunnel relay, I see there too that only Tenant is the only channeldata property which is not null. Here's what I see in tunnelrelay:
"entities":[{"locale":"en- US","country":"US","platform":"Windows","type":"clientInfo"}],"channelData":{"tenant":{"id":"our_tenant_id"}}}
Also, regarding the teamID expected as a parameter to the FetchChannelList method, how do I find out what that is for a given team other than the GetChannelData() method? I tried the powershell cmdlet Get-Team (for example: Get-Team -User me#abc.com). It returns a distinct groupId for each team I am a part of, but I'm assuming groupId != TeamId. Is that correct? And, where can I find the teamId that the FetchChannelList is expecting other than the GetChannelData method?
Thanks in advance for any help!
The problem here was that the message to the bot (the activity) was a direct message, not a part of a channel conversation. Apparently, the Channel and Team properties are only available in a channel conversation.
Also, regarding the team ID, one way to get it outside of code is to click the "..." next to the team and click "get link to team". You will see something like:
https://teams.microsoft.com/l/team/19%3a813345c7fafe437e8737057505224dc3%40thread.skype/conversations?groupId=Some_GUID&tenantId=Some_GUID
The line after team/ (19%3a813345c7fafe437e871111115934th3%40thread.skype) contains the teamId, but not exactly. If you replace the first % and the two characters immediately following it with : and the second % and the two characters immediately following it with #, that is your teamid. So, from:
19%3a813345c7fafe437e871111115934th3%40thread.skype
the team ID is:
19:813345c7fafe437e871111115934th3#thread.skype
Im using Eventbrites api to get information about events. I cant find any price information on the event, even though I can see price information if I check the events page at eventbrite site.
I can see from here that there is an optional property "ticket_availability", but its seems to be non-existing, even though I can see price info on the eventĀ“s eventbrite page)
Further down in the documentation its also mention something called "Ticket class", that should be an anonymous object, but I cant find it anywhere,
(and yes, I have contacted their dev support)
[Accepted answer, cant set it until tomorrow]
Answer from eventbrite:s dev support. If you see this: THANKS!(again) :D
Ticket Classes are the object that we use to represent the prices of an event.
I think this is the endpoint you're looking for:
GET /v3/event/[EVENT ID]/ticket_classes/
https://www.eventbrite.com/developer/v3/endpoints/events/#ebapi-get-events-id-ticket-classes
That will return a list of Ticket Class objects (since events can have more than one price). Here's the documentation on the Ticket Class object it self. The cost field is what you are likely interested in.
I ran into this issue and it turns out ticket_availability is an expansion field for the event endpoints, so you have to request it specifically.
For example, this request:
https://www.eventbriteapi.com/v3/venues/28582043/events/
Would need to become:
https://www.eventbriteapi.com/v3/venues/28582043/events/?expand=ticket_availability
This section of the documentation explains expansions: https://www.eventbrite.com/platform/api#/introduction/expansions
At the top of the documentation for Events you can see the list of expansions that are available for event endpoints: https://www.eventbrite.com/platform/api#/reference/event
ticket_availability doesn't contain the full data on the tickets, so using Ticket Classes as the other answer mentions is the way to go if you need a lot of information about tickets for a particular event. For example:
https://www.eventbriteapi.com/v3/events/216395423537/ticket_classes/for_sale/
I am doing a bit add-in development for outlook 2010 and I'm trying to get the ContactItems associated to an email (MailItem). I think the MailItem.Links collection should return what I want, but it's empty. Maybe I'm on the wrong path, but I'm out of ideas at the moment.
I have an Outlook.MailItem and I like to get the associated Outlook.ContactItem. When you open a mail with outlook and hover over the mail-adresses a contact-popup appears, so the link must be somewhere in the MailItem, but I don't know where.
For example, I tried using the MailItem.Links collection which says in tooltip that it represents the contacts to which the item is linked.
Explorer explorer = application.ActiveWindow() as Explorer;
MailItem mail = explorer.Selection as MailItem;
foreach (Link l in mail.Links)
{
System.Diagnostics.Debug.WriteLine("Link: " + l.Name);
}
The MailItem so far is correct, I can do whatever I want with it but
the MailItem.Links collection is empty.
You should try using the MailItem.Recipients collection which contains the addresses where the message will or has been be sent to (i.e. To, CC, BCC). You will have to check the Recipient.AddressEntry to see if the address exists in the Contacts Address Book (CAB) via GetContact, otherwise you will have to resolve it using ExchangeUser via GetExchangeUser.
The AddressEntry.AddressEntryUserType will tell you what type of recipient is included in the message - Exchange User or List, CAB, or basic SMTP address.