CAN´t connect GPTs with REST API Wordpress

I want to make my own GPTs to modify through REST API my WordPress page, and I don’t know how to do it. There is a Schema section, and I don’t know what code to put there since the one I put from wordpress doesn’t work. I saw that someone in a facebook post was able to do it wrote something in their GPT and it automatically generated the content on their website.

I have put the following schema but it gives me error:

POST myweb. com/wp-json/wp/v2/posts
Headers:
Authorization: Basic MyUserAndPasswordBase64
Content-Type: application/json

Body:
{
“title”: “Título del Post”,
“content”: “Contenido del post.”,
“status”: “publish”
}

1 Like

You have to create an OpenAPI schema.

@alvaropsp28 Were you able to figure this out? I just posted a similar question on my profile, cant share link here

you should use Plugin ( JWT Auth – WordPress JSON Web Token Authentication)

you’ll have to tweak some stuff in your .htaccess and wp-config.php files – just follow what the plugin description says.

then test your WP API, you can use tools like Postman or HTTPie.

then use Authorization: Bearer {your token}
It’s “Bearer”, not “Basic”

By the way, i have issues with POST and PUT requests, especially with long content, it may be related to a limitation or issue with ChatGPT

1 Like

Welcome to the community. Great first post!

Would you be interested in writing up a how-to or guide for doing so? I’m sure many members would be thankful. If you don’t have the time, no worries. Hope you stick around, though. We’ve got a great community going here.

1 Like

Thank you for the warm welcome

Of course I will

1 Like
2 Likes