Exemplo n.º 1
0
    def delete(self, query: str):
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = BUXApiConfig.base_endpoint_url + query
        request = requests.delete(url, headers=headers)
        print(request)
        print(request.json())
Exemplo n.º 2
0
    def post(self, query: str, data: dict) -> str:
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = BUXApiConfig.base_endpoint_url + query
        request = requests.post(url, json=data, headers=headers)
        return request.json()
Exemplo n.º 3
0
    def put_with_data(self, query: str, data: dict):
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = BUXApiConfig.base_endpoint_url + query
        request = requests.put(url, json=data, headers=headers)
        print(request.json())
Exemplo n.º 4
0
    def put(self, query: str):
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = BUXApiConfig.base_endpoint_url + query
        requests.put(url, headers=headers)
Exemplo n.º 5
0
    def stats_query_with_data(self, query: str, data: dict) -> str:
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = "https://api.getbux.com/stats/2/graph/" + query
        request = requests.get(url, headers=headers, params=data)
        return request.json()
Exemplo n.º 6
0
    def query_with_data(self, query: str, data: dict) -> str:
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = BUXApiConfig.base_endpoint_url + query
        request = requests.get(url, headers=headers, params=data)
        return request.json()
Exemplo n.º 7
0
    def query(self, query: str) -> str:
        headers = BUXApiConfig.get_bearer_headers(self.access_token)

        url = BUXApiConfig.base_endpoint_url + query
        request = requests.get(url, headers=headers)
        return request.json()