POST /faqs - Create a Post

POST /faqs - Create a Post

آخر تحديث: الأربعاء, ديس 11, 2024
https://xeno.app/rest/v2/faqs

Headers

Authorization: Bearer TOKEN

Content-Type: application/json

Body:

{
	"title": "New FAQ",
	"content": "<p>Awesome FAQ!</p>",
	"status": "published",
	"faq_category_id": 42,
	"widgets": ["api_key_1", "api_key_2"],
        "language": "fr"
}

Example Request

require "uri"
require "net/http"

url = URI("https://xeno.app/rest/v2/faqs")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer TOKEN"
request["Content-Type"] = "application/json"
request.body = '{ "title": "New FAQ", "content": "<p>Awesome FAQ!</p>", "status": "published", "canned_response": true, "faq_category_id": 42, "widgets": ["api_key_1", "api_key_2"] }'

response = https.request(request)
puts response.read_body

REST API - Posts

5 مقالة في هذه الفئة.