Eventbrite API: The user_id you requested does not exist - with OAuth token - eventbrite

Does anyone know why when requesting /me/owned_events with a valid token you can possibly get "The user_id you requested does not exist".
To me it looks like an issue with the Evenbrite account - but I can find no effective way of raising a support ticket with Eventbrite for the API, so hoping someone has seen this before.
https://www.eventbriteapi.com/v3/users/me/owned_events/?token=XXXXXXXXXXXXXX
{
"status_code": 404,
"error_description": "The user_id you requested does not exist.",
"error": "NOT_FOUND"
}

The endpoint that you are trying to reach is in the process of being deprecated. You will want to switch to using the newer "organizations" endpoint.
GET /v3/organizations/organization_id/events
This will return all of the events owned by the user/organization.
If you are unsure of how to get the organization id you can find that here.
https://www.eventbrite.com/platform/api#/reference/organization/list/list-your-organizations
I hope this helps you move forward!
Best!

Related

Send message to self-Chat in Microsoft Teams using Graph API

I'm trying to send a message to my self-Chat in Microsoft Teams through a Graph API call but can't find the ID of this specific chat. For the record, this type of chat was introduced to Teams in June, 2022.
By reading the Graph API documentation, it's possible to list all chats available for a specific user using the following API call (in this case, myself):
[GET] https://graph.microsoft.com/beta/me/chats/
Yet, I can't seem to find my self-chat in there. The chat itself is already created since I wrote messages in it but it doesn't appear in the call response.
I've tried to filter the results by most recent results, by filtering on my own name or by filtering by ChatType, but it was still missing.
Is anyone aware of a way to get the ID of a user self-chat in Microsoft Teams?
Thanks!
Self chat is a special kind, You can use this endpoint to communicate with it:
https://graph.microsoft.com/v1.0/me/chats/48:notes/messages
Hope that helps :)
Answering harrywyn's question regarding the pop up notification, you can set it as unread the same as any chat like this:
EndPoint = f'https://graph.microsoft.com/v1.0/chats/48:notes/markChatUnreadForUser'
update_chat = {
"user": {
"id" : uid,
"tenantId": TENANT_ID
}
}
resp = requests.post(EndPoint, headers=headers, verify=False, json=update_chat)

Microsoft teams messaging extension inconsistently sending a valid conversation ID to use in a graph call

I am developing a MSTeams application, and inside I use a messaging extension. Upon opening the extension, a request is fired over to my message handler, which I use an azure function to handle. Alongside the request is a payload, with details about the context (in this case the conversation or chat) of where the messaging extension was opened from.
Now, I've built up a graph URL with the conversation ID from the payload:
const id = context.req.body.conversation.id
const graphEndpoint = encodeURIComponent(`https://graph.microsoft.com/beta/me/chats/${id}/members`)
I authenticate a user by calling microsoftTeams.authentication.authenticate({...}) before I make the call, and use the token in the request.
Sometimes, this call will succeed, and return the information I want. However, the other times it will fail with a 400, telling me I had a bad request, despite it being a GET request with no body.
I notice in bad requests, that the conversation ID doesn't trail with #thread.v2 or #unq.gbl.spaces etc. I have no clue why this is so inconsistent, or if it's my fault. Any help would be appreciated.
EDIT: I have also seen that the issue only occurs when the id starts with a:, and succeeds when it starts with 19:. However, the context in which I open the messaging extension is the same each time: In a 1:1 / User:User chat.
I have previously implemented installing the bot in the conversation to get this information, but this method is very undesirable. Perhaps a side point - it seems that the conversations where I have previously installed the bot seem to return the 19: id, and everything else a:.
Here's an example of the 400 response:
{
"error": {
"code": "BadRequest",
"message": "Bad Request",
"innerError": {
"date": "2021-01-25T09:43:26",
"request-id": "3bb55aa2-e694-4c80-952c-88842f482dc1",
"client-request-id": "3bb55aa2-e694-4c80-952c-88842f482dc1"
}
}
}
The conversation id you received in the turn-context is not the chat-id. The conversation id is different from conversation id. Conversation id the id between bot and the user and chat id the id of the chat. Both are different. You cannot use conversation id to call the graph API. Please use the chat id to call graph API. You can get the chat id using list chats API.

Incomplete Linkedin OAuth 2.0 access token response

My question is about OAuth2 access token response from Linkedin api. When I'm trying to get this token I recieve the following response:
{"access_token":"...","expires_in":...}
But the thing is that according to OAuth2 documentation (in 5.1 paragraph) there should be at least one more required parameter - "token_type".
So the question is: could it be somehow customized so the linkedin API will return this parameter with access token response or it is just a departure from the rule and this parameter won't be returned?
Thanks in advance.
I have run into the same issue. According to LinkedIn Docs:
A successful Access Token request will return a JSON object containing the following fields:
access_token — The access token for the user. This value must be kept secure, as per your agreement to the API Terms of Use.
expires_in — The number of seconds remaining, from the time it was requested, before the token will expire. Currently, all access tokens are issued with a 60 day lifespan.
they respond with
{"access_token":"...","expires_in":...}
which violates the standard.
Currently I am using Spring Security 5.0.3 and to fix the issue, I had to monkeypatch one class:
com.nimbusds.oauth2.sdk.token.BearerAccessToken
I will not post the whole class, only a significant part:
public static BearerAccessToken parse(final JSONObject jsonObject)
throws ParseException {
// Parse and verify type
AccessTokenType tokenType;
try {
tokenType = new AccessTokenType(JSONObjectUtils.getString(jsonObject, "token_type"));
} catch (ParseException ex) {
tokenType = AccessTokenType.BEARER;
}
if (!tokenType.equals(AccessTokenType.BEARER))
throw new ParseException("Token type must be \"Bearer\"");
//...
}
I hoped to get answer from Linkedin member since they stated on their site that stackoverflow is a proper place for asking such questions. But since there is no answer from them and I didn't find any relevant information regarding this question I believe that it is just the way they implemented OAuth 2.0 protocol.

YouTube Reporting API Returns 400 and 401 Error while creating a job

I'm using YouTube Reporting Api to get my CMS account's datas as bulk reports.
I am using Api Explorer with my CMS user account. I have enabled YouTube Reporting API from console but whenever I'm trying the following request, I get 401 error. I believe that I'm missing something or doing something wrong but I couldn't find it. What is the exact reason of this issue?
Mr. Ibrahim Ulukaya , you are the one who created the PHP sample codes for YouTube Reporting API. How can I solve this issue?
Thank you! :)
This is my request;
POST https://youtubereporting.googleapis.com/v1/jobs?onBehalfOfContentOwner=contentOwner%3D%3DContent_Owner_Name&fields=id%2CreportTypeId&key={YOUR_API_KEY}
{
"reportTypeId": "content_owner_ad_performance_a1"
}
This is the Response;
401 OK
Show headers -
{
"error": {
"code": 401,
"message": "The request does not have valid authentication credentials.",
"status": "UNAUTHENTICATED"
}
}
Edit
When I don't add Content Owner name, I get 400 Error..
Here's my request;
POST https://youtubereporting.googleapis.com/v1/jobs?fields=name%2CreportTypeId&key={YOUR_API_KEY}
{
}
Here's the response;
400 OK
Show headers -
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
I solved this problem...
401 error happens because I was thinking that I should add my Content Owner Name at OnBehalfOfContentOwner section. According to YouTube documentation, It's supposed to be my Content Owner ID. (The content owner's external ID on which behalf the user is acting on.) When I added my Content Owner ID, the request was fine..
400 Error happens because I left the OnBehalfOfContentOwner section blank and didn't write anything. According to YouTube documentation, f the request does not specify a value for this parameter, the API server assumes that the request is being made for the user's own channel.. If it is acting as your own channel (not content owner), you cannot retrieve anything from Content Owner Reports. You can only choose something from Channel Reports. If you try retrieving data from Content Owner Reports while acting as your own channel, the request will be invalid because it cannot see the report in the Channel Report list.
The most important things are;
If you are trying to retrive Content Owner reports, you should use your Content Owner ID , not Content Owner name on OnBehalfOfContentOwner section.
You should choose a correct report id from the list which you are acting as...

LinkedIn "Invitation API": Where are the "Member ID + auth Token" when inviting with ID?

I'm developing an iOS app using the LinkedIn API. Everything works fine but I'm having problems with the "Invitation API"
I don't understand what the "Member ID + auth token" are, I need those to make the call to the server...
This is what the documentation says about it:
Member ID + auth token: If the invitee was found using a search API call, then the search result will have included the member ID and auth token to make the API call. Use both of those to identify the member to invite.
So aparently those are fields that come when I search for the contact using the search API. To search for contacts I do the following call to the server:
NSString *url = [[NSString stringWithFormat:#"https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,headline,distance))?keywords=%#&facet=network,S&sort=distance&count=25&oauth2_access_token=%#&format=json",keywords, self.auth.accessToken] stringByAddingPercentEscapesUsingEncoding:
NSASCIIStringEncoding];
This works fine, and returns what I' looking for but I never get back the "Member ID + auth token". First I thought it was because I was selecting just some fields from the people so I check in the "Search API" if there is some field called "Member ID" or "Auth Token" but there is not. So I'm really lost... where do I found those values?
Any Idea?
I found the answer to get the token to send invites. When performing the search is necessary to add the field "api-standard-profile-request"
After that when performing the search you will get:
<api-standard-profile-request>
<url>http://api.linkedin.com/v1/people/T4sKMZ8qEN</url>
<headers total="1">
<http-header>
<name>x-li-auth-token</name>
<value>NAME_SEARCH:1Mlb</value>
</http-header>
</headers>
</api-standard-profile-request>
And that's it... I hope it helps someone!

Resources