Hello folks.
I’m trying to fetch guru cards from specific boards/collections/teams and was wondering whether there’s a specific endpoint to do this.
Best answer by Joe Duffy
View originalHello folks.
I’m trying to fetch guru cards from specific boards/collections/teams and was wondering whether there’s a specific endpoint to do this.
Best answer by Joe Duffy
View originalHi
Here are the API calls you’re looking for:
POST https://api.getguru.com/api/v1/search/cardmgr
{
"queryType": "cards",
"collectionIds": [
"{{collectionId}}"
]
}
POST https://api.getguru.com/api/v1/search/cardmgr
{
"queryType": "cards",
"query": {
"nestedExpressions": [
{
"type": "board-ids",
"ids": [
"{{boardId}}"
]
}
],
"op": "AND",
"type": "grouping"
}
}
Hope this is helpful - let me know if you need anything else!
Joe
Based on Joe Duffy’s tip, I wrote the following python examples:
def find_card_in_collection(search_text, collection_id):
''' Find cards using search string(s) in the specified collection'''
url = “https://api.getguru.com/api/v1/search/cardmgr"
#Search a Collection...
payload = {
"queryType": "cards",
"searchTerms": "test",
"maxResults": 50,
"collectionIds": [collection_id]
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Basic xxxMyEncodedUserId&Pwdxxx"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
def find_card_in_folder(search_text, folder_id):
''' Find cards using search string(s) in the specified folder '''
url = "https://api.getguru.com/api/v1/search/cardmgr"
#Search a Folder...
payload = {
"queryType": "cards",
"searchTerms": search_text,
"query": { "type": "folder-ids", "ids": [folder_id] }
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Basic xxxMyEncodedUserId&Pwdxxx"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.