rogers-obrien-rad / ProPyCore

Interact with Procore through Python for Data Connection Applications (no user authentication)
MIT License
4 stars 0 forks source link

[BUG] `get_budget_details()` should be a POST request #56

Closed HagenFritz closed 2 months ago

HagenFritz commented 2 months ago

Current Behavior

Currently, the get_budget_details() function uses a GET request when the documentation says the request should be a POST.

Expected behavior

We need to use the post_request() method instead.

Screenshots

def get_budget_details(self, company_id, project_id, budget_view_id):
        """
        Return a list of all rows from the Budget Detail Report for a Project and Budget View.

        Parameters
        ----------
        company_id : int
            unique identifier for the company
        project_id : int
            unique identifier for the project
        budget_view_id : int
            unique identifier for the budget view

        Returns
        -------
        """
        params = {
            "project_id": project_id
        }

        headers = {
            "Procore-Company-Id": f"{company_id}"
        }

        details = self.get_request(
            api_url=f"{self.endpoint}/{budget_view_id}/budget_details",
            additional_headers=headers,
            params=params
        )

        return details

Additional context

HagenFritz commented 2 months ago

Related to #58