Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jupyter-naas
GitHub Repository: jupyter-naas/awesome-notebooks
Path: blob/master/Agicap/Agicap_List_companies.ipynb
2973 views
Kernel: Python 3

Agicap.png

Agicap - List companies

Give Feedback | Bug report

Tags: #agicap #companies #accountingsoftware #financialmanagement #businessmanagement #financetracking #budgetplanning #invoicing #expensetracking #businessinsights #dataanalysis

Last update: 2023-04-12 (Created: 2023-01-10)

Description: This notebook lists all the companies within Agicap with their IDs. Agicap is a powerful accounting software for managing your company's finances. It offers features such as expense tracking, budget planning, invoicing, and data analysis to help you make informed business decisions.

Input

Import libraries

import requests import naas import pandas as pd

Setup Variables

token = naas.secret.get("AGICAP_API_TOKEN") or "eGu3qPIo6kuetXXXXXXXX"

Model

Retrieve Companies

Now you have generated your API Token, it's time to try it with your first API call. For this, we are going to start by calling the GET /companies endpoint that allows you to retrieve all the Companies linked to your Agicap account (through your API Token).

url = "https://openapi.agicap.com/api/companies" # Headers headers = { "Accept": "application/json", "Authorization": f"Bearer {token}", } # Rcompany_idequest res = requests.get(url, headers=headers) res.raise_for_status res

Tranform json to dataframe

df = pd.DataFrame(res.json()) df.head(1)

Output

Display result

print("Companies fetched:", len(df)) df