Error 400 Bad Request when querying for list of projects - api

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.

Related

Branch.io api update type. Make previously created link appear on quick links

I created a bunch of links through the API without specifying the type which defaults to 0. This doesn't make the links show on the dashboard under quick links. Now, I would like to make them show there but there doesn't seem to be an option to add a quick link, only create new. Given this, my idea was to use the API to read and update it however, update doesn't seem to allow passing argument type. Any hints on how to overcome this?
I have made a get request, retrieving the whole link details, copied the result, added the branch_key and branch_secret, changed type from 0 to 2 and sent an update request.
I've opened the link with ?debug=true but it doesn't seem to be a way to edit it to make it show on quick links either.
Response code was:
{
"error": {
"code": 400,
"message": "Invalid parameter: type"
}
}
As soon as I remove the type parameter, I get the proper link response with all the data.
The error that you saw is the expected behavior. The "type" key is reserved key and is not able to be changed once you created the link. You can manually set this only when you create the link using the API call. Please do reach out at integrations#branch.io if you have any further questions!
We store API created links and quick links in different DBs due to the volume of each type. This means that it's actually impossible to create a quick link through our public API or SDK. The only place would be from the dashboard. :( Hopefully, you understand our reasoning for doing it this way.

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.

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

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.

Cannot access SharedWithMe Folders via microsoft graph api

I am trying to download the items of a shared folder following the v1.0 reference guide. I am able to retrieve the basic details by using the /v1.0/me/drive/sharedWithMe request.
sharedWithMe Response
However when I try and request the contents of the folder using the '/drives/remoteItem.driveId/items/id' request I get a 'itemNotFound' error code.
/drives/b!SuVijei8UUiLXWR4XeJPFe-SS3gbCDVJuXZLcatX7Ikm3BPqZMVJTLOW4rsDD7B2/items/01GB75254SYRXS4C7C25HLIWFMXFY7HWB3
"error": {
"code": "itemNotFound",
"message": "The resource could not be found.",
"innerError": {
"request-id": "2a0591bd-6fdf-4bf8-a5f3-baca24fd1930",
"date": "2016-08-29T14:03:25"
}
Any ideas what is going on?
Thanks!
EDIT:
I was able to retrieve SharedWithMe folders data by using the '/drives/remoteitem.parentReference.driveId/items/remoteItem.id/children'
It seems also very important to use a scope of Files.Read.All (which seems to be currently undocumented)
It looks like you are almost there. All you need is the /content segment.
Expected: /drives/remoteItem.parentReference.driveId/items/id/content
Your actual: /drives/remoteItem.parentReference.driveId/items/id
You'll get redirected to the resource for download. I think the documentation should be updated
And just to make sure, the base url is a bit different:
To get the shared item content: /v1.0/drives/drive-id/items/item-id/content
To get the list of shared items: /v1.0/me/drive/sharedWithMe

Microsoft Graph API on OneDrive returning error on retrieving children

I have authenticated to OneDrive and am trying to query it using the Microsoft graph API. I tried the documented query:
https://graph.microsoft.com/v1.0/drive/root/children
However, this returns an HTTP 500 with a JSON body that includes:
...
"code": "InternalServerError",
"message": "Unsupported extension property type.",
...
Some other queries such as /drive/root and /drive/root:/Documents work fine, but I can't get children to list.
You need to use this url to make it work:
https://graph.microsoft.com/v1.0/me/drive/root/children
Thanks
We've identified an issue with such requests for personal Microsoft accounts (LiveId). It has been corrected and you should no longer see such failures.