Skip to main content

I currently have a zap that uses python in code by zapier. 

  • This script make an API call and returns 999 values in JSON (1000 is the limit)
  • Trying maintain a real-time updates on values in multiple columns on these 1000 records
  • My API call through code by zapier grabs all of the latest information when it runs. 
  • When I go through the steps in edit it seems to work on the one I use as example
  • When I run the entire zap it gives me the “ no new data” message every single time. 
  • It appears that the script does not actually refresh my API information within the zap when I press run
  • I am not sure it is going through each of the 999 records either
  • When it searches for a record, it add a new record if a match is not found. The the next step I have it updating the information on existing. Is that the correct process to do this?

I probably just need to be pointed in the right direction.  Here is a screenshot of the zaps. 

 

Hi ​@lEmNiCk 

For us to have more info, we would need to see how the Zap step 1 Python Code is configured.

The Zap step 1 would run every 10 minutes.

 

If the Zap step 1 is returning line items, then you can iterate thru each line item using the Looping Zap app: https://zapier.com/apps/looping/help

NOTE: The Looping Zap app has a limit of 500 iterations.


I have an output here. 

It shows the line items from the API - It splits the results into different records.

I am trying to make an API call to FileVine because the current app in zapier only works with the old API and I have a new API with a bearer token. 

I will have to delete this image after your response.

 


@lEmNiCk 

We would need to see screenshots showing how the python code within Zap step 1 is configured to have more context.

 


import requests

# Credentials
personal_access_token="PAT",
client_id="CID",
client_secret="CIS",
# Get bearer token
token_url = "BEARER TOKEN URL"
token_data = {
"grant_type": "personal_access_token",
"token": personal_access_token,
"client_id": client_id,
"client_secret": client_secret,
"scope": "THE SCOPES"
}
token_response = requests.post(token_url, data=token_data)
bearer_token = token_response.json()["access_token"]

# Get user/org IDs
org_url = "ORGS TOKEN URL"
org_headers = {"Authorization": f"Bearer {bearer_token}"}
org_response = requests.post(org_url, headers=org_headers)
org_data = org_response.json()
user_id = org_data["user"]["userId"]["native"]
org_id = org_data["orgs"][0]["orgId"]

# Get project list
project_url = "REPORTS URL"
project_headers = {
"Authorization": f"Bearer {bearer_token}",
"x-fv-userid": str(user_id),
"x-fv-orgid": str(org_id)
}
project_params = {
"limit": 500,
"offset": 0,
"excludeArchived": False
}

project_response = requests.get(project_url, headers=project_headers, params=project_params)
output = project_response.json()

Here you go


I am going to move forward with a webhook so I can actually automate this. Can I delete this thread?


Reply