Update WPCT REST CE Landing API authored by Pau Pulido's avatar Pau Pulido
......@@ -108,6 +108,81 @@ title: "test-desde-bash",
}
```
En el següent exemple creem un nou post per una nova CE, amb títol "test-desde-bash" i associat a la company 5. Hem de passar el token obtingut un cop s'ha realitzat l'autenticació amb JWT. La resposta en cas d'èxit és la següent:
```json
{
"id": 1713,
"date": "2023-03-02T11:46:47",
"date_gmt": "2023-03-02T11:46:47",
"guid": {
"rendered": "https:\/\/somcomunitats.coop\/?post_type=rest-ce-landing&p=1713",
"raw": "https:\/\/somcomunitats.coop\/?post_type=rest-ce-landing&p=1713"
},
"modified": "2023-03-02T11:46:47",
"modified_gmt": "2023-03-02T11:46:47",
"password": "",
"slug": "",
"status": "draft",
"type": "rest-ce-landing",
"link": "https:\/\/somcomunitats.coop\/?post_type=rest-ce-landing&p=1713",
"title": {
"raw": "test-desde-bash",
"rendered": "test-desde-bash"
},
"content": {
"raw": "",
"rendered": "",
"protected": false,
"block_version": 0
},
"author": 5,
"comment_status": "open",
"ping_status": "closed",
"template": "",
"permalink_template": "https:\/\/somcomunitats.coop\/rest-ce-landing\/%pagename%\/",
"generated_slug": "test-desde-bash",
"odoo_company_id": "5",
"_links": {
"self": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/rest-ce-landing\/1713"
}],
"collection": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/rest-ce-landing"
}],
"about": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/types\/rest-ce-landing"
}],
"author": [{
"embeddable": true,
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/users\/5"
}],
"replies": [{
"embeddable": true,
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/comments?post=1713"
}],
"wp:attachment": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/media?parent=1713"
}],
"wp:action-publish": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/rest-ce-landing\/1713"
}],
"wp:action-unfiltered-html": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/rest-ce-landing\/1713"
}],
"wp:action-assign-author": [{
"href": "https:\/\/somcomunitats.coop\/wp-json\/wp\/v2\/rest-ce-landing\/1713"
}],
"curies": [{
"name": "wp",
"href": "https:\/\/api.w.org\/{rel}",
"templated": true
}]
}
}
```
headers: 'Content-Type: application/json', "Authorization: Bearer $token"
domain: /wp/v2/rest_ce_community
......
......