I have create a WordPress multi site, and now I am trying to add sub sites via the REST API, but I am unable to create,
the website seems to be working fine, and I can create the subset normally front the dashboard, but via the api it gives internal server error.
this is the code I am using and the error (server response)
wordpress_endpoint = "https://aiwebsitebuilder.tech/wp-json/wp/v2/sites/create"
wordpress_username = 'xxxx@outlook.com
wordpress_password = 'xxxx xxxx xxxx xxxx xxxx xxxx'
auth = (wordpress_username, wordpress_password)
wordpress_data = {
"title": "My New Site",
"admin_email": "bilalmoten2@gmail.com" ,
"domain": custom_domain_name
}
wordpress_response = requests.post(wordpress_endpoint, auth=auth, json=wordpress_data)
if wordpress_response.status_code == 201 or wordpress_response.status_code == 200:
print("WordPress site created successfully!")
else:
print("Failed to create WordPress site")
print(wordpress_response.text)
print(wordpress_response.status_code)
would love any help I can get
Error:
Failed to create WordPress site
{"code":"internal_server_error","message":"<p>There has been a critical error on this website.<\/p><p><a href=\"https:\/\/wordpress.org\/documentation\/article\/faq-troubleshooting\/\">Learn more about troubleshooting WordPress.<\/a><\/p>","data":{"status":500},"additional_errors":[]}
500