Instagram oauth api gives {"error_message": "Matching code was not found or was already used.", "code": 400, "error_type": "OAuthException"} - api

I am seeing this error from my live server using the Instagram API.
{
"error_message": "Matching code was not found or was already used."
, "code": 400
, "error_type": "OAuthException"
}
I have read a few suggestion on here to clear cache but that isn't fixing the issue. I am also unable to submit a support ticket directly on the Instagram site as I am receiving an error message while attempting to submit a ticket.

I was also facing the same problem. I have tried all the solutions available on the SO. But it didn't work.
When I debugged the that Instagram code in details, I found that Instagram was providing the code something like this after authorization -
AQAbo7gLQMVRqC4NitrEGSj6tPa8UBREsSYDAL7IZcthASbSKaJANrry3HgQnofJuY4nJx9NTuo_eO4SV8ol4-olk0Y4NzhbXkxTw8G9dBq-T3uZuBzRIVJd61LsYHq15tIeDswI82ri6lt7ngc76eoAAAypgGc3cq9DqayVb7oCpfWZEym6KPH_hJMVaoUOAjN9OT1EEtYuUhmUFgJHHEy66ab9LgHZLXiFxugYBkrdKw#_
It started working when I removed the ending 2 charaters #_ from the code.
Below is the final code that I used to get the access_token -
AQAbo7gLQMVRqC4NitrEGSj6tPa8UBREsSYDAL7IZcthASbSKaJANrry3HgQnofJuY4nJx9NTuo_eO4SV8ol4-olk0Y4NzhbXkxTw8G9dBq-T3uZuBzRIVJd61LsYHq15tIeDswI82ri6lt7ngc76eoAAAypgGc3cq9DqayVb7oCpfWZEym6KPH_hJMVaoUOAjN9OT1EEtYuUhmUFgJHHEy66ab9LgHZLXiFxugYBkrdKw
This was a simple solution in my case.
I hope this will help people in case they are still facing this issue.

Related

GET Save Queries from log Analytics via Azure API

Hi there i'm trying to get the queries i've saved in log analytics via an API GET Request. and following the guide (even testing it from the Documentation page) doesn't work. I know the queries are there and are saved, am i missing something?
I follow this documentation:
Microsoft Docs - Saved Searches - Get
I Call the API like this:
GET
https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}?api-version=2015-03-20
Authorization: Bearer eyJ0...eXAQ
And the respons i get is this:
404 Not Found
{
"error": {
"code": "SavedSearchNotFound",
"message": "Saved search '[NAME OF MY SAVED QUERY]' could not be found."
}
}
I really cant figure out what the problem is here. Has anyone encountered this before?
Found My Answer:
The "{savedSearchId}" is supposed to be a guid... As i tried to find one at the beginning when constructing the URL i coundn't find an id for each search query. so i thought it was the name of it.
You can find the Query by clicking the three dots to the right of each saved query and click edit.
The query will show the ID for it under the name in Gray text.

BIM 360 field API login issues

Frustrating issue with attempting to use REST to login to the BIM 360 Field API, it was suggested that to use the postman application in order to ensure that my code wasn't an issue, however I'm now getting an unauthorized error, this has been attempted with an admin account and a developer account with the same response (login details are definitely valid), I was wandering if anyone has encountered this problem before or has any idea how would go about getting past this, I need to get the ticket response in order to go any further with developing an application for this, I'm already in contact with someone from Autodesk but due to timezone differences responses are difficult!
I've attached a picture to highlight the simplicity of what I'm attempting to do with no joy!
Thanks in advance
Dan
In case somebody else hits the same issue, FYI -
Dan and I looked at this issue, and we learned (in a hard way) that the base URL for BIM 360 Field in European region is:
https://bim360field.eu.autodesk.com
Notice "eu" in the URL. In the U.S., it is https://bim360field.autodesk.com
I wrote a post about this, too, for future reference:
https://fieldofviewblog.wordpress.com/2016/08/18/base-url-for-bim-360-field-in-european-countries/
I also found it worked when I used https but not http although the examples in the help use http.

How to know if Youtube User is verified or not

I need to know whether a Youtube user defined is "Verified" or not. This information is not on the API so I tried with curl/file_get_content to get the source code of the page but Youtube blocked my connection from my server and returned me this:
(Starting from line #88) Sorry for the interruption. We have been receiving a large
volume of requests from your network.
To continue with your YouTube experience, please enter the verification code below.
Has anyone found a solution to this problem?
I found a solution but I have several bugs... On the API Youtube I can get the ID Google Plus of the Channel Youtube refered.
After I get this ID, I can go to the API Google Plus and found if this people is verified or not like this :
http://nsa38.casimages.com/img/2015/05/13/150513030741753689.png
This line return me a boolean true or false but it's working half the time :
Check this ID Google Plus : 110195395364554964153
He have an account verified, but the API return me "Verified : False"
Then check this ID Google Plus : 116623617560812527856
He have an account verified and the API return me "Verified : True"
After this, I was looking for search a people with YouTube API but I have a problem, I searched "Pascal Obispo" and Youtube return me this :
youtube.com/results?search_query=pascal+obispo&filters=channel&lclk=channel
He don't found "pascalobispoVEVO" and I don't understand why ? I can found it if I search like this :
youtube.com/results?filters=channel&search_query=pascal+obispo+vevo&lclk=channel
But this is not practical.. Anyone have a solution?
Thanks, sorry for my English that's not my best langage and I have not the reputation for post the links and image in flat sorry !

Error 400 Bad Request when querying for list of projects

I am trying to query the list of projects available to a user with the Asana API as shown in their documentation under the title "Show all projects in a workspace or organization", but I am encountering a 400 Error.
The error message details being returned are:
{
"errors": [
{
"message": "Missing required `team` field"
}
]
}
I am using the following endpoint except that I am using my actual workspace ID:
https://app.asana.com/api/1.0/workspaces/14916/projects
The documentation for this example does not mention a team field, and the only reference to the team field applies to create-only operations. Does anyone have an idea as to what my issue is?
Without having additional information, it sounds like the query might actually be using the wrong HTTP verb - maybe POST? - rather than a GET.
Can you show the exact request you make, how you make it? An example with curl is usually a good common denominator, but code would work as well.

Unable to access a post's insights for someone else's page

When I access this resource:
https://graph.facebook.com/xxx_yyy/insights
I get this response:
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/xxx_yyy/insights?format=json&since=-86400&until=0",
"next": "https://graph.facebook.com/xxx_yyy/insights?format=json&since=0&until=86400"
}
}
The insights data is empty. "xxx_yyy" is a valid post id I got from the feed.
I have the read_insights permission.
I have the offline_access permission.
I'm an admin on the page.
The page has more than 30 likes.
What's causing the API to return an empty insights array?
There are a few requirements for you to get data back from the Facebook Insights graph API call. These don't appear to be clearly documented anywhere, but this is what I have found by trial and error.
The post must be from the page itself, posts from other people won't return insights data
Look at the id in the From object within the post response from facebook, if that is different than the page_id, you won't get metrics.
It's good to note that I haven't unequivocally proved this point, just some anecdotal testing seems to point in this direction
The post must be quite old, I was able to dig up something on one of their Ads FAQs that post insights won't be available for 12-15 hours after the end of the day they were posted on.
"Page post metrics will be available 12 to 15 hours after the end of the day the post was made. Metrics are logged on Pacific Standard Time." Page Post Metrics FAQ -Ads and Business Solutions
I have yet to determine the exact age that posts need to be precisely, but my guess is 36 hours would be a safe general bet. That being said, Facebook Insights data has been known to fall behind from time to time, so I would assume that the timing with which you can attain data will be variable.
FB documentation on page post insights is available primarily in this Facebook blog post
Invalid ID is a key. xxx_yyy in the question means ID must be a combination of appID (xxx part) and postID (yyy part).
So, here is the right Url for post-related metrics:
https://graph.facebook.com/[appID]_[postID]/insights
You must use PAGE token not USER token.
connect to app with manage_pages and read_insights permission
run api https://graph.facebook.com/me/accounts?access_token=USERTOKEN
this expression lists all pages with access token for each page, that you save and use the expression for the post insights
then run expr.
https://graph.facebook.com/xxx_yyy/insights?access_token=PAGETOKEN