How to retrieve e-mail campaign information via API
Hey all,
I have been trying to get information about e-mail campaigns running on my organization's Domo instance.
I have been able to find the information needed through a GET request at the following endpoint: https://campaigns-prod.domolabs.io/api/v1/email/campaigns/
However, I struggle to authenticate correctly. I tried using a bearer token, an access token generated at developer.domo and some other methods (mainly using client_id and client_secret). I also tried using the request header "X-DOMO-Developer-Token".
I have been able to access the information authenticating via a request header "X-Auth-Token", using a value I found in a request in the network tab of the inspector panel in the browser while inspecting the relevant campaign app.
How can I generate said token, or any other correct way of authentication, for this specific purpose? I'd prefer to avoid 3rd party libraries, but would be willing to use pydomo.
Thank you
Answers
-
If you are trying to call an API, perhaps you could look at the Domo AppStore for an appropriate API connector. Search JSON. Some connectors require tokens or some type of authentication account to be configured. Possibly something like the No Code oAuth Connector.
I use this type of connector to connect to my data source. Once I have the account configured, I simply select it from the dropdown.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
@ArborRose
Thank you for your suggestions. I may be mistaken but I believe your solution is not quite what I'm looking for, since what I am trying to do is connect to Domo from an external source to extract data from Domo. Not the other way around. Let me know in case I misunderstood what you meant1 -
Is this what you are looking for? In Python…..
import requests
client_id = 'your_client_id'client_secret = 'your_client_secret'url = 'https://api.domo.com/oauth/token'data = {
'grant_type': 'client_credentials',
'client_id': client_id,
'client_secret': client_secret
}
response = requests.post(url, data=data)
token = response.json()['access_token']** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
@MattTheGuru this sounds related to your question. You aren't able to access Campaign resources using the normal x-domo-developer-token, correct?
0 -
Yeah, @ellibot that's correct. The dev token doesn't work in this case, BUT @NoahFinberg found a great solution.
Check out these awesome docs:https://domo-support.domo.com/s/article/360043441853?language=en_US
If these trouble you at all mention me and I'll record a video showing a demo :)** Was this post helpful? Click 💡/💖/👍/😊 below. **
** If it solved your problem. Accept it as a solution! ✔️ **
Or do you need more help? https://calendly.com/matthew-kastner/15-minute-chat
Did I help you out? Feedback is priceless and will help me more than you know.Write a review!0 -
Credit goes to @ConnorGrieb!
0 -
@ArborRose
Thank you for your suggestion. Not quite, credentials generated that way don't work on this endpoint.0 -
@MattTheGuru
Thank you for that reference! I had already come across it, but it didn't really seem to apply to my situation, so I ignored it.
I tried doing a GET request to https://campaigns-prod.domolabs.io/api/v1/email/campaigns/ with 'domoAccessToken', 'domoAccessTokenOwnerEmailAddress', and 'instance' as headers. But it still doesn't work, returning a 403 response ('Forbidden').
I would greatly appreciate if you could do a demo as you suggested. Just bear in mind, please, that my goal is to retrieve information on the existing campaigns in the instance. Something that I can do through a GET request to the endpoint stated above and providing a 'X-Auth-Token' header with a value (which is user-specific) that I found in the network tab of the inspector panel in the browser. Let me know if any other details are necessary.
Thank you in advance!0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive