Skip to main content
Question

Python drama - SyntaxError

  • November 15, 2023
  • 1 reply
  • 39 views

Hi Zapier team!

I have seen this posted before, though none of the fixes in comments seemed to solve the problems for me. I have some code (below) which works well in terminal:

 

curl --request POST \
  --url "https://api.hubapi.com/crm/v3/exports/export/async" \
  --header "Authorization: <Hidden bearer token>" \
  --header "Content-Type: application/json" \
  --data-raw '{
      "exportType": "VIEW",
      "exportName": "External Fleet Summary Report",
      "format": "CSV",
      "language": "EN",
      "objectType": "DEAL",
      "type": "CRM_EXPORTS",
      "portalId": 5848966,
      "primaryExportObjectTypeId": "0-3",
      "objectProperties": [
        "dealname",
        "partner_customer_reference_number",
        "tesla_gateway_serial_number__c",
        "nmi__c",
        "gateway_provider",
        "_battery_option",
        "_vpp_enrolment_date",
        "_vpp_unenrolment_date",
        "_vpp_status",
        "battery_commissioning_status",
        "retailer_tariff_reference_number",
        "state_province__c",
        "distribution_network__c"
      ],
      "associatedObjectType": "COMPANY"
  }'

unfortunately when i run the code through the Code by Zapier python stage I receive the following error code:

SyntaxError: invalid syntax (<string>, line 8)

Are you able to offer some guidance?

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Troy Tessalone
Forum|alt.badge.img+14

Hi @Hugpuf 

Good question.

Did you already review these help articles for using Python in a Code step?

https://zapier.com/apps/code/help

 

You may instead want to use the Webhooks app: https://zapier.com/apps/webhook/help