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

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.

Related

Coinbase Webhooks: is there a list of all data available?

I am looking into the webhook notifications and I am struggling to find documentation...
I would need to find the different payload for the "data" in the notification response...
the documentation only have one example: https://developers.coinbase.com/api/v2#show-a-notification
it is almost impossible to built an app if I need to try and see every type of notification by myself... (trial and error approach :( )
any extra resource? any help here?
thank you all
On this page, there is a link that says
See full list of notifications and corresponding payload information
But guess what, it links to the pages in your OP.
Even CB's newest documentation doesn't outline the payload until you run a sample to get the result displayed in the docs page. Here is a simple example, just click Try It to see the payload. It's not a bad thing until you need to see the payload of a signed request, then it's a PITA...
I've never used their webhooks to know how the payload differs but considering their docs you may need to run each notification to see what to expect and save the result to refer to later.

Drive API Update:

I use the following API call (with a valid key) and it has stopped working for one folder but still works for another. When it doesn't work I get an empty "files": [] response rather than a error. I can see that the update has impacted the folder that doesn't work but I don't understand why as they both look the same. I have tried appending &resourcekey=yyy but it makes no difference.
What can I do to fix the problem in either the Drive UI, the API credentials, or in the API call?
https://www.googleapis.com/drive/v3/files?q=%270B6Gv6UcT0j6HY2VKbzktd2F1Z2M%27+in+parents&spaces=drive&fields=files(mimeType%2Cid%2Cname%2CthumbnailLink%2CimageMediaMetadata%2Cdescription)&key=xxx
Thanks for your help.
Be sure to pass the following HTTP header:
X-Goog-Drive-Resource-Keys
along with your request, and set its value to:
[FOLDER_ID]/[FOLDER_RESOURCE_KEY]

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.

Missing enrollment terms in Canvas LMS API

I am currently doing some work with the Canvas LMS REST API and have run into an issue when trying to retrieve a list of all enrollment terms defined in the system. When viewing the terms in the online system, I can see all the terms that have been created, from the first ones up to the furthest defined semester. However, when I try to get a list of terms using
GET /api/v1/accounts/:account_id/terms
I only receive a list of 10 terms, while the rest are missing. Does anyone know what could be causing this?
Additionally, is there a difference between a Term and an EnrollmentTerm object? I only see API calls for EnrollmentTerm objects, while a Term seems to be a subset of the data contained in an EnrollmentTerm that only gets passed within a Course. Could someone explain if there is an important difference here, and what I may be missing?
Lastly, could anyone point me towards some information about error codes that are returned from an API call? For example, when I use
POST /api/v1/accounts/:account_id/terms
with some associated parameters, I get a 400 bad request response. When the parameters are incorrectly named, I get a 500 response instead. Any guidance on this matter would be very helpful.
Let me know if there is anything I can do to help clarify things. Thanks for your help!
I got into contact with Canvas developers and found out that this was caused by how they paginate their API responses. Their default cap appears to be at 10 per response, but this can be extended up to 100 by adding ?per_page=100 at the end of the query like so:
POST /api/v1/accounts/:account_id/terms?per_page=100
Additional pages can be retrieved using the URLs returned in the Link header of the response. More info on that can be found here.
An example Link header would be:
<https://<canvas>/api/v1/accounts/:account_id/terms?page=1&per_page=10>; rel="current",
<https://<canvas>/api/v1/accounts/:account_id/terms?page=2&per_page=10>; rel="next",
<https://<canvas>/api/v1/accounts/:account_id/terms?page=1&per_page=10>; rel="first",
<https://<canvas>/api/v1/accounts/:account_id/terms?page=10&per_page=10>; rel="last"
The URLs in the Link header are only included when they are relevant, so the first page will not return a "prev" link and the last page will not return a "next" link, for example.

Google Custom Search API curl trouble

I'm a newbie at stackoverflow so please be patient with me :)
I'm trying to get access with the Google Custom Search API.
But I get return that I can't understand.
My query is like this:
https://www.googleapis.com/customsearch/v1?&key=********&q=red%2Bsox&cx=**********&start=0&num=10&cr=countryCA&lr=lang_fr&client=google-csbe&output=xml_no_dtd
And the result I get is this?
string '{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Value"}],"code": 400,"message": "Invalid Value"}}' (length=172)
What am I doing wrong?
I want the result from Google to appear.
Thanks in advance :)
You don't have a cx.
Take a look at this answer
What happens is because this api is used mostly for adding a search option
for your site you have to specify you custom search engine (e.g. search only your site).
When you want this to search the web by code you need to do the above. Add a fake
site (where you would add your search textbox), configure it (search the web, or your site, or whatever else) and then delete the fake site
Update
Oh god, i just saw that. Sorry. Well the problem is that you start with 0. Valid is 1. Change start=0 with start=1 and i think you would be good to go. Take a look at this for valid values for the start parameter official page