Why am I getting a "TypeError: Cannot read properties of undefined (reading 'oauth_access_token')" error when invoking an action through the connect REST API?

This topic was automatically generated from Slack. You can find the original thread here.

Hi. I am trying to invoke an action through the connect REST API but it is giving me this error

the payload i am sending to /connect/${project_Id}/actions/run sending look like this:

 {'external_user_id': 'user_id', 'id': 'google_sheets-add-single-row', 'configured_props': {'google_sheets': {'authProvisionId': 'account_Id'}, 'sheetId': 'sheet_id', 'worksheetId': 'work_sheet_id', 'hasHeaders': False, ****otherProps}}

and my headers are configured like this:

{
            "Authorization": f"Bearer {self.access_token}",
            "Content-Type": "application/json",
            "X-PD-Environment": self.environment
 }

but it is giving me this error:

{'os': [{'ts': 1745001736662, 'k': 'error', 'err': {'name': 'TypeError', 'message': "Cannot read properties of undefined (reading 'oauth_access_token')", 'stack': "TypeError: Cannot read properties of undefined (reading 'oauth_access_token')\n    at Object.drive (file:///tmp/__pdg__/dist/code/e4207de98c73060cf90653524592081661abecd9e78d47c101ab55bdc7e8c265/node_modules/.pnpm/@pipedream+google_drive@0.9.1/node_modules/@pipedream/google_drive/google_drive.app.mjs:299:34)\n    at Object.getFile (file:///tmp/__pdg__/dist/code/e4207de98c73060cf90653524592081661abecd9e78d47c101ab55bdc7e8c265/node_modules/.pnpm/@pipedream+google_drive@0.9.1/node_modules/@pipedream/google_drive/google_drive.app.mjs:809:26)\n    at Object.run (file:///tmp/__pdg__/dist/code/e4207de98c73060cf90653524592081661abecd9e78d47c101ab55bdc7e8c265/code/actions/add-single-row/add-single-row.mjs:131:57)\n    at file:///var/task/component_maker.mjs:151:42\n    at captureObservations (/var/task/node_modules/@lambda-v2/component-runtime/src/captureObservations.js:28:11)\n    at run (file:///var/task/component_maker.mjs:141:26)\n    at MessagePort.<anonymous> (file:///var/task/component_maker.mjs:177:15)"}}]}

Would appreciate any advice! Thanks!

Can you try passing the authProvisionId under googleSheets instead of snake case? You always want to use the app prop name that’s returned in the component definition.

thanks!! It works now

on another note

how would i say invoke an action for an app that has no auth_type

would i still need to give an authProvisionId

an exampe would be the HTTP requests app. Thank you!

HTTP actions aren’t well documented, that’s true — can you tell me more about the core use case? Do you have an execution environment within your app?

Oh i see. I was just asking since it is available but I do think we can just default to using our own.

Also, I am trying out the e2b-run-code action to create a file
it is currently giving this output when invoking an action:

{
  "exports": {
    "$summary": "Successfully interpreted code."
  },
  "os": [],
  "ret": {
    "results": [
      {
        "text": "<PIL.Image.Image image mode=RGBA size=800x400>",
        "png": "base64 image"
      },
      {
        "text": "/tmp/random_line_chart.png"
      }
    ],
    "logs": {
      "stdout": [],
      "stderr": []
    }
  }
} 

in this case is the file in the /tmp/ directory accessible in any way from pipedream or is it still sitting on the E2B side?

I also was wondering if we can make custom actions for an app and make it available to the connect api?

in this case is the file in the /tmp/ directory accessible in any way from pipedream or is it still sitting on the E2B side?
Yea, /tmp is accessible to other actions within Pipedream’s execution environment — would you want access to it outside of action executions? We’re chatting about some related features here, so would love to know about your use case for working w/ local files via the Connect API.

I also was wondering if we can make custom actions for an app and make it available to the connect api?
Not currently, but we’ve talked about this in the past — would these be totally bespoke actions that you wouldn’t want to publish to the Pipedream public registry? Or do you just want the flexibility of not being constrained by what we have available? Or something else?

Yea, /tmp is accessible to other actions within Pipedream’s execution environment — would you want access to it outside of action executions? We’re chatting about some related features here, so would love to know about your use case for working w/ local files via the Connect API.
Yes, i would prefer a way to access the files, either downloading it to somewhere or ideally, have it available as a public accessible URL
Not currently, but we’ve talked about this in the past — would these be totally bespoke actions that you wouldn’t want to publish to the Pipedream public registry? Or do you just want the flexibility of not being constrained by what we have available? Or something else?
I think it would be the latter (having flexibility). I have some semrush integrations that I want to expose to my end users via the connect api and i saw that pipedream have a semrush auth set up but do not have components available so if we can do that, that would be great