I am not getting address of event in Eventbrite API search respose - eventbrite

I am using Eventbrite API to search events around me and to locate them on map,but I am unable to get the address information in search response.

Add one more param in your request like below:-
https://www.eventbriteapi.com/v3/events/search/?location.address=Indore&expand=organizer,venue&token=MY_EVENTBRITE_TOKEN

In your event search responses you should find a "venue_id" field.
You will then need to make another call to the API to get the venue details:
For example:
https://www.eventbriteapi.com/v3/venues/VENUE_ID/?token=YOUR_OAUTH_TOKEN
Returns ..
{
"address":{
"address_1":"101 foobar st",
"address_2":null,
"city":"Sydney",
"region":"NSW",
"postal_code":"2000",
"country":"AU",
"latitude":"-33.8737891",
"longitude":"151.213161",
"localized_address_display":"101 foobar st, Sydney, NSW 2000",
"localized_area_display":"Sydney, NSW",
"localized_multi_line_address_display":[
"101 foobar st",
"Sydney, NSW 2000"
]
},
"resource_uri":"https://www.eventbriteapi.com/v3/venues/25210646/",
"id":"25210646",
"age_restriction":null,
"capacity":null,
"name":"Sydney",
"latitude":"-33.8737891",
"longitude":"151.213161"
}

You can customize the request as per your way!
For Helpful: https://www.eventbrite.com/developer/v3/quickstart/
By latitude,longitude,within:
https://www.eventbriteapi.com/v3/events/search/?location.latitude=23.06&location.longitude=72.53&location.within=100km&token= Your_personal_OAuth_token

Related

Microsoft Graph translateExchangeIds not returning the same id as EWS

I am working with both EWS and the Graph API.
I would like to create events (online meetings with skype/teams) in an calendar that is already available via EWS.
To match the calendar to the one available via Graph API i try to use https://learn.microsoft.com/en-us/graph/api/user-translateexchangeids
The calendar i created has this id when returned by the FindFolder call:
<t:FolderId Id="AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA=" ChangeKey="..."/>
<t:DisplayName>Test</t:DisplayName>
I create a request to the graph api:
{
"inputIds": [
"AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA="
],
"sourceIdType": "ewsId",
"targetIdType": "restId"}
and get the result
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.convertIdResult)",
"value": [
{
"sourceId": "AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA=",
"targetId": "AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA="
}
]
}
However, if i call https://graph.microsoft.com/v1.0/me/calendars i get a different id
"id": "AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgBGAAAAAABW2gY0kRG1SqggDTNZN6i8BwBIq5JjIBY-RqWQllrF0GSkAAAAB353AAAPJkKZ1XJkQ6huFmcVa6XaAAGixNowAAA=",
"name": "Test",
Is there a way to match the (ews) calendar i already have to the one returned by the Graph API?
This is a shot in the dark, because I've never dug this deeply into the weeds on the Graph Ids, but you might try calling Graph with the header that selects "immutable ids." I tried to find some details on what this actually means without much luck.
The header is:
request.Header("Prefer", "IdType=\"ImmutableId\"");
HTH, and if not, sorry for guessing.

How do I get a usable email message reference id from headers to use in a Microsoft Graph query?

I am trying to use the references message ID in email headers of a forwarded email in Office 365 to then find the original email that has that message ID.
The references ID in the forwarded email's headers would show something like what's shown below. Note I'm obtaining these headers from Microsoft Graph by adding &$select=internetMessageHeaders to my query using sender/subject to find the forwarded email.
{
"name": "References",
"value": "<CAOLK2SAEzvs=-6Rs5cTbgORNivQVK2AvMJDJT8o+ghx-XhCn7w#mail.gmail.com>"
}
However, if I take this and use it in a query like https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq '<CAOLK2SAEzvs=-6Rs5cTbgORNivQVK2AvMJDJT8o+ghx-XhCn7w#mail.gmail.com>'
I do not receive any results.
If I hunt down the original email in Microsoft Graph using sender and subject, I see the following for the internetMessageId field for the original email:
{
"name": "Message-ID",
"value": "<CAOLK2SC6s9Me05kYRqeuEHKK8DrQbXx34ScT0AzGOFFLMdRapg#mail.gmail.com>"
}
Does anyone have any ideas on what Office 365 or Microsoft Graph is doing to change CAOLK2SAEzvs=-6Rs5cTbgORNivQVK2AvMJDJT8o+ghx-XhCn7w into CAOLK2SC6s9Me05kYRqeuEHKK8DrQbXx34ScT0AzGOFFLMdRapg? It looks like some sort of encoding, but I haven't been able to reproduce it.
Ultimately I would like to be able to transform what I'm getting in the references ID header such that I can turn around and use that ID to find the original email using Microsoft Graph.
The id is a hashed value that, among other things, includes the path/folder that the message resides in. So if you, for example, move a message (say from Inbox to Archive) then you should expect the id to change.
For tracking a message, regardless of its location, you should use the internetMessageId ($select=internetMessageId) property instead.
I discovered the issue. In my test message-ID I have the characters = and +
These characters must be URL encoded to %3D and %2B before being used in the $filter query. When they are URL encoded, I am able to find the original email using MS Graph.
In Microsoft Graph v1.0 and beta, you can obtain "immutable ids" by sending an additional HTTP header in your API requests:
Prefer: IdType="ImmutableId"
I've put immutable in italics as this is the term Microsoft uses. Be aware of the following caveats, the ID will change if:
The user moves the item to an archive mailbox;
The user exports the item (to a PST, as an MSG file, etc.) and re-imports it into their mailbox;
The user creates a draft which they later send;
You can also convert existing ids to immutable ones by the following request:
POST https://graph.microsoft.com/beta/me/translateExchangeIds
{
"inputIds" :
[
"AQMkAGM2…"
],
"targetIdType" : "restImmutableEntryId",
"sourceIdType" : "restId"
}
Which will give you the response:
HTTP 200 OK
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.convertIdResult)",
"value": [
{
"targetId": "AAkALgAA...",
"sourceId": "AQMkAGM2..."
}
]
}

microsoft-graph message ID

I call my mailbox using REST calls to MSGraph:
GET https://graph.microsoft.com/v1.0/me/mailfolders/inbox/messages
As expected I receive a Json with my mails.
To play with a specific mail (move, delete,forward, ...) I saw that the API should be called like
POST me/messages/{id}/forward
I can't target the message if I provide the value of the id field that I get from the JSon. Where to find the correct {id} that I should use?
my result is like the example at https://developer.microsoft.com/en-us/graph/graph-explorer see id: field when calling GET my mails.
Thanks
The id from JSON is OK. what you missing is you have not set the post conent for move/forward.
If you use the forward API, you should set the post content like below:
{
"Comment": "FYI",
"ToRecipients": [
{
"EmailAddress": {
"Address": "XXX#XXX.onmicrosoft.com"
}
}
]
}
This is the worked forward url for me(you can implement the move/delete like this too):
https://graph.microsoft.com/v1.0/me/messages/AAMkAGNjZTcyZDJmLTkzMjYtNGQwNi05Y2UxLTc5NDk0NjEwNjJjMABGAAAAAAAUYpVLVYiKTINMO3MZR0H5BwB3NF3PTyl5QIQd59edwRO9AAAAAAEMAAB3NF3PTyl5QIQd59edwRO9AAApBI9fAAA=/forward
For information please see:
https://learn.microsoft.com/en-us/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations#ForwardDirectly

Microsoft Graph - Retrieving invalid contact email address

If an Office 365 contact's email address is invalid (ex: user#example?com), how do I retrieve the the email address with Microsoft Graph?
I've tried /contacts and /contacts/{id}. The first returns an empty address:
"emailAddresses": [
{
"name": "name",
"address": ""
}
]
and the second simply omits it:
"emailAddresses": [
{
"name": "name"
}
]
Edit: By "contact" I mean Outlook contacts accessible in the Office 365 People app, not regular Office 365 users. Sorry if my question was unclear.
I'm not sure if this would work, but perhaps give it a try.
string email = await graphClient.Users[your_users_id].Request().Select("Mail").GetAsync().Mail;
To get the answer above, I used this Get User documentation which briefly talks about Select statements. And this documentation has a list of the properties which are available to the Select statement.
Found an issue on Github that solved my problem.
Turns out an Exchange contact's (first) EmailAddress has an hidden PidLidEmail1OriginalDisplayName in addition to its address.
When you set the email address to an invalid one, the invalid address is stored in the OriginalDisplayName and its address is cleared, which is the reason the contact's email address is (Empty) in Office 365 People's contact list but the invalid address seems to still be there when you edit the contact.
PidLidEmail1OriginalDisplayName is an MAPI property. In order to obtain it, we need to use extended properties. The request should look like below but with the spaces URL-encoded to %20:
GET /me/contacts/{id}?$expand=singleValueExtendedProperties($filter=id eq 'String {00062004-0000-0000-C000-000000000046} Id 0x8084')
The response should include an additional field containing the invalid address:
"singleValueExtendedProperties": [
{
"id": "String {00062004-0000-0000-c000-000000000046} Id 0x8084",
"value": "user#example?com"
}
If the contact has multiple email addresses, use PidLidEmail2OriginalDisplayName/PidLidEmail3OriginalDisplayName for the contact's second or third email address.

Get event rsvp summary using koala gem in rails

I have been able to retrieve event details using
#graph = Koala::Facebook::API.new(access_token)
#eventSummary = #graph.get_object(eventId)
and getting users list invited using
#eventSummary = #graph.get_connections(eventId, "invited")
I want to get count for all user invited, maybe, Declined and accepted for the event. for which i'm using
#eventSummary = #graph.get_connections(eventId, "invited?summary=1")
which again giving me the list of users only. when used graph.facebook like
https://graph.facebook.com/***eventId***/invited?access_token=*****access_token****&summary=1
i'm getting the count in result.
{
"data": [
{
"name": "xyz",
"rsvp_status": "attending",
"id": "10000000123"
}
],
"paging": {
"next": "https://graph.facebook.com/***eventId***/invited?summary=1&access_token=***accesstoken***&limit=5000&offset=5000&__after_id=100004389574321"
},
"summary": {
"noreply_count": 0,
"maybe_count": 0,
"declined_count": 0,
"attending_count": 1,
"count": 1
}
}
for just solving purpose i'm getting result using fql, as:
#eventSummary = #graph.get_object("fql", :q => "SELECT all_members_count, attending_count, declined_count, not_replied_count, unsure_count FROM event WHERE eid = #{eventId}")
But this is not convenient to use.
Can anyone please help, what am i doing wrong ? To get Event RSVP counts.
I'm using rails v.3.2, for facebook using Koala gem.
Thanks in advance.
I've seen it too, that when you request the event itself, those attendee count fields aren't included. You can use the second parameter to specifically ask for them though:
#eventSummary = #graph.get_object(eventId)
#eventSummary.merge(#graph.get_object(eventId, fields: "attending_count,declined_count,interested_count"))
The first call gets your "standard" event details, something like this:
{"description"=>"Blah blah blah",
"name"=>"My Event Will Rock",
"place"=>{"name"=>"Venue Bar",
"location"=>{"city"=>"Citytown",
"country"=>"United States",
"latitude"=>43.05308,
"longitude"=>-87.89614,
"state"=>"WI",
"street"=>"1216 E Brady St",
"zip"=>"53202"},
"id"=>"260257960731155"},
"start_time"=>"2016-04-22T21:00:00-0500",
"id"=>"1018506428220311"}
The second call gets just those "additional" requested fields:
{"attending_count"=>3,
"declined_count"=>0,
"interested_count"=>12,
"id"=>"1018506428220311"}
You can store them in separate variables, or as I'm suggesting above, use the hash#merge method. (There shouldn't be any problematic overlap between the keys of these two hashes.)
Alternatively, you can get all these details in one request by explicitly requesting everything you want.

Resources