user-1
(User 1)
March 10, 2025, 1:55pm
1
This topic was automatically generated from Slack. You can find the original thread here .
I have an API GET request working fine in Postman, but when I convert it to Node in Pipedream the endpoint returns a 404. Am I missing something? I have other endpoints in pipedream for this same service on different endpoints so I feel like Im missing something. TIA! Here’s the code:
// To use any npm package, just import it
// import axios from "axios"
import { axios } from "@pipedream/platform";
export default defineComponent({
async run({ steps, $ }) {
const domainAccountsResponse = await axios($, {
url: 'https://api.dmarcreport.com/v2/accounts/17333/domain_accounts',
headers: {
"Authorization":
Token token=${process.env.DMARCReport}``
}
})
console.log(domainAccountsResponse)
},
})
user-1
(User 1)
March 10, 2025, 1:55pm
2
The URL in the request looks correct according to this API doc: API documentation
user-1
(User 1)
March 10, 2025, 1:55pm
3
Maybe that account ID 17333 doesn’t exist?
user-1
(User 1)
March 10, 2025, 1:55pm
4
Thanks yes I agree. I’ve double checked everything. The same URL using 17333 works in postman this is why I find this odd.
user-1
(User 1)
March 10, 2025, 1:55pm
5
I’ve asked the vendor and they say there is no issue, they also said they tried it in pipedream, but provided no evidence as such.
user-1
(User 1)
March 10, 2025, 1:55pm
6
Hmm maybe then the process.env.DMARCReport
env var is not returning properly?
user-1
(User 1)
March 10, 2025, 1:55pm
8
// To use any npm package, just import it
// import axios from “axios”
import { axios } from “@pipedream /platform”;
export default defineComponent({
async run({ steps, $ }) {
console.log(process.env.DMARCReport);
const domainAccountsResponse = await axios($, {
url: 'https://api.dmarcreport.com/v2/accounts/17333/domain_accounts',
headers: {
"Authorization": `Token token=${process.env.DMARCReport}`
}
})
console.log(domainAccountsResponse)
},
})
user-1
(User 1)
March 10, 2025, 1:55pm
9
Does anything show in the logs? (don’t post it here)
user-1
(User 1)
March 10, 2025, 1:55pm
10
yes it does - redacted here
user-1
(User 1)
March 10, 2025, 1:55pm
11
I use this same code / context / process.env in other functions in other places on other endpoints at this vendor. It’s the first time I’ve tried this particular end point.
user-1
(User 1)
March 10, 2025, 1:55pm
13
Yeah weird, the code you shared is absolutely 100% correct, so I wonder what’s the issue here
user-1
(User 1)
March 10, 2025, 1:55pm
14
If you’d like I can look further into it asap, submit a support ticket here: Support - Pipedream
user-1
(User 1)
March 10, 2025, 1:55pm
15
Thanks I will. I’ve pushed back on the vendor too to look deeper
user-1
(User 1)
March 10, 2025, 1:55pm
16
Btw you can also request an integration with Dmarc Report here:
user-1
(User 1)
March 10, 2025, 1:55pm
17
So instead of using environment variables for the token you can use our native app integration