I'm having difficult sending a HTTP API call. I'm inserting all the "Find Emails by Company" from Hunter.io and selecting all properties, but my HTTP API end-point isn't receiving the "emails" key and value pair from the API.
Based on the Hunter API integration documentation, the output field is named "Emails" (with a capital 'E') and it returns an array type. Make sure you're using the exact field name "Emails" in your HTTP API call, as API fields are often case-sensitive. Source: Find Emails by Company with Hunter
Looks like you're still looking for help. We're escalating this over to our support team and someone should be in touch soon. In the meantime, feel free to include any other information that may be helpful in solving your issue!
{ "name": "Name", "domain": "Domain", "law_firm_status": "response", "emails": "Find Emails by Company" }
This is the JSON body that I am sending w/ the Columns inserted. I'm using the Find Emails by Company and selecting all properties, but my HTTP api end-point doesn't receive the data
Pedram - Do you mind sending the link to the table so we can take a look? https://downloads.intercomcdn.com/i/o/1171717996/ac7729f84b426e1d0358af02/image.png?expires=1734551100&signature=6e691a40ce0010244245967352b80bbe999229d7e6ab5bc485418574d072e978&req=dSEgF85%2FmohWX%2FMW1HO4zYTywS%2F5A5YX2BKsam%2FhVPsVKw%3D%3D%0A
Could you please assist and help me Bo
This is very critical to our work to send all the data points
Are you there?
Hello?
I can see why the data isn't coming through. 1. Your enrichment setup looks correct - The endpoint is returning a 500 error - The JSON structure you're sending matches the Find Emails enrichment output - The server is expecting the data in this specific format 2. Next steps: - We should check if the API endpoint is working properly - Verify the request payload format matches what the endpoint expects - Consider retrying the request after confirming the server is stable
What's happening at row 16?
It's saying an error message: "Failed to parse body input"
It had an issues with the quotation mark. Since you're adding an entire object the HTTP API was confused and was showing this error due to the extra quotes. I've went ahead and fixed the JSON structure directly using this: "{\n \"name\": \"" + Clay.formatForJSON({{Name}}) + "\",\n \"domain\": \"" + Clay.formatForJSON({{Domain}}) + "\",\n \"law_firm_status\": \"" + Clay.formatForJSON({{Law Firm Status}}?.response) + "\",\n \"emails\": " + JSON.stringify({{Find Emails by Company}}) + "\n}"
Did you add a column?
I see HTTP API (2)
But the body in here looks the same as HTTP API
Yes so I can test the setup without hurting what you've already did :)
You should teach me what you did, so I understand
That's correct, because I fixed it using the formula instead of the body you see You can see by clicking on the gear icon and > formula :)
I don't see the Formula though
Absolutely. The original code had an issue where we were trying to directly insert a JavaScript object into a string, which caused it to show up as "[object Object]". This happens when JavaScript tries to convert an object to a string automatically. Let's look at it step by step: 1. Original problematic part: "\"emails\": \"" + {{Find Emails by Company}} + "\"" This is the way we format data normally because it's a one off fields, When this runs, JavaScript sees an object and tries to make it a string by itself, giving us "emails": "[object Object]" - which isn't valid JSON. 2. Fixed version: "\"emails\": " + JSON.stringify({{Find Emails by Company}}) The key differences: - Removed the extra quotes around the emails value - Added JSON.stringify() which properly converts JavaScript objects into JSON strings For example, if your email object looks like: {emails: [{email: "test@example.com"}]} The old way would output: "emails": "[object Object]" The new way outputs: "emails": {"emails": [{"email": "test@example.com"}]} This creates valid JSON that can be properly parsed. Does this help?
{ "name": " Name ", "domain": " Domain ", "law_firm_status": " response ", "emails": Find Emails by Company }
this is what I see in the Body
Thanks, I see it now
I'll study this
So essentially it's JavaScript parsing the values right?
The body data as a formula is JavaScript am I right?
Ok, cool
Exactly! JavaScript is handling the parsing of values here. Think of it as adding JSON.stringify() to say "Here's exactly what's inside that object, formatted correctly as JSON" instead of Hey, this is some kind of object
Exactly! :)
Ok, thanks Bo. This will help us out a great deal.
What response value should I be sending back to Clay from my endpoint so that it marks it as successful
Also, if there is an error in a column for example law_firm_status will it still pass in the data and provide Error in that field or a value like Error?
Any responses would work here. You can send okay or you can also keep this empty :)
Is it possible to whitelist the IP's that clay has? I only want those IP's, where can I get a whitelist IP set
No it's not possible unfortunately :)
Also, could you tell me why the rows like 14, and 15 don't send data to the HTTP API endpoint?
Let me get back to you in few !
Please don't forget about me
No - So the error happens because there's no email within that field and it's receiving empty data to parse. What were you thinking of? Sending this still even if it's empty? it would make more sense to only ignore here
No, I need to know that it's not a law firm or not, even if it doesn't have emails.
Got it! Let's split this into two separate HTTP APIs to handle those cases: 1. Set up your first HTTP API for when Hunter.io doesn't run 2. Create a second HTTP API with a formula to run only if the first one didn't work 3. This way, you'll still get that "NOT A LAW FIRM" info even without email data Typically we could use a Merge columns to merge the value you want with another column that says N/A, for example, but in this case, it would be too big for handling within one cell.
This thread was picked up by our in-app web widget and will no longer sync to Slack. If you are the original poster, you can continue this conversation by logging into https://app.clay.com and clicking "Support" in the sidebar. If you're not the original poster and require help from support, please post in 02 Support.