Hla mus rau cov ntsiab ntsiab lus

Tsim cov ntawv siv Brand Palette

Hauv qhov piv txwv no peb yuav saib yuav ua li cas los tsim cov ntawv siv Brand palette. Nyob rau hauv cov ntaub ntawv uas tus neeg siv lub hom palette twb teem, qhov no yuav override cov uas twb muaj lawm chaw thiab yuav siv cov tshiab hom palette los tsim posts.

Yog koj hla dhau brand_details parameter, ua color_palette_type parameter yuav raug ignored thiab Posts yuav ib txwm tau generated nyob rau hauv lub muab hom palette.

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",
"color_palette_type": "brand",
'brand_details': """{ "color_1":"201ae3",
"color_2":"d2130a",
"color_3":"019a43",
"brand_website":"brandwebsite.com",
"brand_handle":"@test_handle",
"logo_url":"valid-logo-url"
}"""
}

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.