Solved

Is it possible to fetch cards from specific boards/collections/teams via API?

  • 29 September 2022
  • 3 replies
  • 105 views

Userlevel 1

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.

icon

Best answer by Joe Duffy 30 September 2022, 00:19

View original

3 replies

Userlevel 3
Badge

Hi @Kenalpha Kipyegon 👋

Here are the API calls you’re looking for:

Hope this is helpful - let me know if you need anything else!

Joe

 

Userlevel 1

Thank you @Joe Duffy! Absolute legend!

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)

Reply