Hla mus rau cov ntsiab ntsiab lus

Tsim Cov Ntawv Tshaj Tawm uas siv Cov Ntsiab Lus Kev Cai / Subheadings

Hauv qhov piv txwv no peb yuav saib yuav ua li cas los tsim cov ntawv siv koj tus kheej cov ntsiab lus. Koj tuaj yeem muab cov ntsiab lus rau nqe lus, subheading rau txhua nplooj ntawv ntawm kev muaj tswv yim. Koj tuaj yeem xa cov ntsiab lus rau cov ntsiab lus mos txwv yog tias koj tab tom tsim cov ntawv teev npe.

Yog tias koj hla cov kab ntawv xov xwm, AI yuav tsis tsim cov ntsiab lus rau cov kab ntawv xov xwm / subheadings thiab lwm yam thiab yuav siv cov xov xwm uas tau muab rau nws. Qhov siab tshaj plaws ntawm cov cim tso cai rau nqe lus thiab subheading yog 200 cim

import requests

url = "https://brain.predis.ai/predis_api/v1/create_content/"

payload = {
"brand_id": "YOUR_BRAND_ID",
"text": "3 tips for a healthy morning breakfast",
"media_type": "single_image",
'headlines': """[{"h1": "Heading for first page", "h2": "Subheading for first page", "cta": "Call to action for first page"}, {"h1": "Heading for second page/first listicle bullet point", "h2": "subheading for second page"}, {"h1": "Heading for third page/second listicle bullet point", "h2": "subheading for third page"}]"""
}

headers = {"Authorization": "YOUR_API_KEY"}

response = requests.request("POST", url, data=payload, headers=headers)

if response.status_code == 200:
json_response = response.json()
post_id = response.get("post_id")
post_status = response.get("status")

else:
print("Error occurred - {}".format(response.text))

Yog tias koj tau txais a inProgress raws li txoj cai hauv teb, koj qhov kev thov tau ua tiav thiab cov ntawv tau txais generated. Thaum cov ntawv tshaj tawm tau tsim ua tiav (lossis ua tsis tiav), koj yuav tau txais kev thov ntawm koj qhov webhook URL teeb tsa nrog cov ntsiab lus ntxiv txog cov posts. Nyob rau hauv rooj plaub ntawm ntau cov posts, koj yuav tau txais qhov kev tshwm sim webhook rau txhua tus ncej cais.