|
|
|
# **Connexió Odoo -> Wordpress. Què necessita la REST API de Wordpress per fer les següents accions desde Odoo:**
|
|
|
|
|
|
|
|
## URL: https://somcomunitats.coop/wp-json/wp/v2/rest_ce_community
|
|
|
|
|
|
|
|
## POST
|
|
|
|
Com crear una CE Landing
|
|
|
|
headers: 'Content-Type: application/json', "Authorization: Bearer $token"
|
|
|
|
domain: /wp/v2/rest_ce_community
|
|
|
|
|
|
|
|
`
|
|
|
|
POST /wp-json/wp/v2/posts/42 HTTP/1.1
|
|
|
|
Host: example.com
|
|
|
|
X-HTTP-Method-Override: DELETE
|
|
|
|
`
|
|
|
|
## PUT
|
|
|
|
Com actualitzar una landing
|
|
|
|
## DELETE
|
|
|
|
Com esborrar una landing
|
|
|
|
|
|
|
|
# **Connexió Wordpress -> Odoo. Què espera la REST API de Wordpress quan fa una petició GET a Odoo:**
|
|
|
|
|
|
|
|
## **Sample request**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## **Success response**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## **Error response**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The wp-api-jwt-auth will intercept every call to the server and will look for the Authorization Header, if the Authorization header is present will try to decode the token and will set the user according with the data stored in it.
|
|
|
|
|
|
|
|
If the token is valid, the API call flow will continue as always.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## **Sample headers**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## **Errors**
|
|
|
|
|