Question

Automated upload of blog article to WIX website using Webhooks


Badge

Hi all, I’m hoping someone here can assist with helping me fix my errors within my webhook action here as I am stuck and not sure how to proceed. I have attached my flow below. What data am I missing or incorrectly entering here to be able to get this action to work please? I am getting a 400 error so I know its on my side.

I appreciate any help you can give. 😊

 


11 replies

Userlevel 7
Badge +14

Hi @RH2508 

To give us more context, post screenshots of the encountered error.

Link to the Wix API endpoint documentation you used to configure the Zap step.

Badge

Thanks @Troy Tessalone, sure thing. See below. Is this what you meant..?

I’m not sure if it’s because the output from Chatgpt is in HTML format or something else?

 

Here is the link https://dev.wix.com/docs/rest/crm/community/blog/draft-posts/create-draft-post

I’m also not sure the API key Wix produced is correct as other keys I have seen are only one line whereas the key I made and copied from Wix is several lines of data so I’m wondering if this is contributing as well?

Here is the data output from zapier.

 

Badge

I also realised I hadn’t put back the data when I was testing, so here is what I’m trying to send as a draft blog post to Wix.

 

Userlevel 7
Badge +14

@RH2508 

Try using this Zap action: Webhooks - Custom Request (POST)

That will allow you to use JSON to format the “draftPost” object child properties.

 

Badge

@Troy Tessalone where do I place the data please..? When I fill in the custom webhook, I still get an error (see below). I know I’m not putting the data in the correct fields but I can’t see what I’m doing wrong..? Forgive my dumbness! 😕

 

Userlevel 7
Badge +14

@RH2508 

Use this BODY format for the JSON.

{
"draftPost": {
"title": "Places to visit in europe"
}
}

 

Badge

@Troy Tessalone Like this..?

 

Userlevel 7
Badge +14

@RH2508 

From the API docs.

Looks like there are more nested objects you would need to define in the JSON for passing the HTML, ans same with the Media.

Try asking ChatGPT for help structuring the JSON based on the API endpoint docs.

 

 

Badge

@Troy Tessalone This is what chatgpt came up with, does this look right..?

 

Badge

@Troy Tessalone Do I need the SEO and keywords in here..?

Userlevel 7
Badge +14

@RH2508 

Feedback from ChatGPT will depend on the prompt you provided. (It may hallucinate.)

 

Example JSON from the API docs

~~~json
{
"draftPost": {
"id": "448d1238-0072-4458-a280-bf81c2dd8af1",
"title": "Places to visit in europe",
"featured": false,
"categoryIds": [],
"memberId": "2d24cb8a-adcc-466a-ab59-fa74e0889a37",
"hashtags": [],
"commentingEnabled": true,
"minutesToRead": 0,
"tagIds": [],
"relatedPostIds": [],
"pricingPlanIds": [],
"language": "en",
"changeOrigin": "AUTO_SAVE",
"contentId": "622f285f7952527f485bc138",
"editingSessionId": "0aca7f65-1237-482e-bf51-6d14102ee691",
"status": "UNPUBLISHED",
"mostRecentContributorId": "2d24cb8a-adcc-466a-ab59-fa74e0889a37",
"hasUnpublishedChanges": true,
"editedDate": "2022-03-14T11:34:55.121Z",
"seoData": {
"tags": []
},
"seoShowInSearch": true,
"seoShowSnippetInSearch": true,
"slugs": [],
"createdDate": "2022-03-14T11:34:55.121Z"
}
}

~~~

 

 

Reply