Exemplo n.º 1
0
def execute_post(api_key, resource_url, body):

    monday_params = MondayQueryParameters(api_key)

    resp = requests.post(format_url(resource_url),
                         body,
                         params=monday_params.to_dict())

    if resp.status_code == 200 or resp.status_code == 201:
        return resp.json()

    raise_mondayapi_error('POST', resource_url, resp)
Exemplo n.º 2
0
def execute_delete(api_key, resource_url, params=None):

    monday_params = MondayQueryParameters(api_key)

    if params != None:
        monday_params.add_params(params)

    resp = requests.delete(format_url(resource_url),
                           params=monday_params.to_dict())

    if resp.status_code == 200:
        return resp.json()

    raise_mondayapi_error('GET', resource_url, resp)
Exemplo n.º 3
0
def execute_put(api_key, resource_url, body):

    monday_params = MondayQueryParameters(api_key)

    data = json.dumps(body)

    resp = requests.post(format_url(resource_url),
                         data,
                         params=monday_params.to_dict())

    if resp.status_code == 200:
        return resp.json()

    raise_mondayapi_error('PUT', resource_url, resp)