403 error in custom app calling code engine function

I am building a custom app that uses a API call to call a code engine function.. when I deploy and run this app it works fine but when I deploy this to different users they are not able to use this functionality..
console log shows 403 error, so I am assuming this is because they don't have access to run code engine function. How do I work around that restriction (apart from just giving everyone access to run code engine which I am not planning to).
Is there a way to impersonate a user access while making this api call? Or perhaps use some service account to make this call?
Thanks for your help!
Best Answer
-
Apparently the issue was that I had not given access to the code engine function to the broader user base. After setting the access level this issue is now resolved.
0
Answers
-
Which API are you using and how are you authenticating? You should be able to use the Product API endpoint for Code Engine and use the X_DOMO_DEVELOPER header to authenticate with an access token.
Was this comment helpful? Click Agree or Like below.
Did this comment solve your problem? Accept it as the solution!1 -
I am calling several APIs but I am guessing the one throwing the error is the one I am using to run the code engine function:
/domo/codeengine/v2/packages/${functionAlias}`
I am not quite sure how to use X_DOMO_DEVELOPER header. Can you expand on that a bit?
0 -
@brycec - your comment made me think about the access level permissions of the code engine itself and I didnt realize until this point that I was support to share the code engine with the users as well. I will do that and hopefully that will resolve this issue. Will update this thread.
0 -
If you are building a Domo app (pro-code or brick), then you will likely need to use one of Domo's SDKs and this authentication hack won't work. But, to use the X-DOMO-Developer-Token header, you simply add a header to your API request key: X-DOMO-Developer-Token, value: <your_access_token>. You can generate an access token inside Domo under Admin > Authentication > Access tokens. For this API, the run code engine endpoint would be <your_instance>.domo.com/api/codeengine/v2/packages/<id>/versions/<version>/<function_name>
I noticed the Product APIs have started being documented in the Domo Developer Documentation. But, if what you need isn't there, you can open up the developer tab on your browser, go to the network console tab, and analyze requests sent using the Domo UI.Was this comment helpful? Click Agree or Like below.
Did this comment solve your problem? Accept it as the solution!1 -
you are correct. I am using Domo SDK to make the API calls (domo.get, domo.put etc.). But thank you for that detail answer. Very insightful!
0 -
Apparently the issue was that I had not given access to the code engine function to the broader user base. After setting the access level this issue is now resolved.
0
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 305 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 107 SQL DataFlows
- 648 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 774 Beast Mode
- 75 App Studio
- 43 Variables
- 733 Automate
- 186 Apps
- 471 APIs & Domo Developer
- 62 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 403 Distribute
- 117 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 137 Manage
- 134 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 113 Community Announcements
- 4.8K Archive