Why does creating a Schematics workspace fail with the API?
Troubleshoot a Bad request error when you create a IBM Cloud Schematics workspace with the API, UI, or CLI because the request payload is incomplete.
The Schematics create workspace fails when you attempt to create using the API by using following CURL command.
curl --request POST --url https://cloud.ibm.com/schematics/workspaces -H "Authorization: Bearer scfQ" -d '{"name":"test_api","type": ["terraform_v1.4"],"location": "eu-de","description": "via api","resource_group": "5e1f06f5b2b24a319f6cd5be86f531dd","tags": [],"template_repo": {"url": "https://xxxxxxxxx/Rise-with-SAP/iac-hec-sap"},"template_data": [{"folder": ".","type": "terraform_v1.4","variablestore": []}]}'
When Schematics runs the CURL command, an error state Schematics cannot find the complete information in the payload. And the workspace create is marked with Bad request message.
{
"requestid": "3b57ed5d-8610-4a86-9864-8d8197b80336",
"timestamp": "2021-09-22T14:49:04.565693526Z",
"messageid": "M1008",
"message": "Bad request. Check that the information you entered in the payload is complete and formatted correctly in JSON.",
"statuscode": 400
}
Verify your CURL or the payload contains that the location and the url are pointing to the same region where you want to create or update the workspace.
For Example
- For creating workspace in
USregion: Uselocationasus-eastorus-southandurlashttps://us-south.schematics.cloud.ibm.com/orhttps://us-east.schematics.cloud.ibm.com/. By defaulthttps://cloud.ibm.com/schematics/workspacespoints tohttps://cloud.ibm.com/schematics/overviewendpoint. - For workspace in the
EUregion: Uselocationaseu-deoreu-gbandurlashttps://eu-de.schematics.cloud.ibm.comandhttps://eu-gb.schematics.cloud.ibm.comendpoint.