This article goes over how to upload a RAML File and publish it to Exchange using the API Designer Experience API. If you are trying to automate using bash scripts with Design Center and Gitlab or Github, these cURL requests will help.
All the calls below require the following information:
curl 'https://anypoint.mulesoft.com/designcenter/api-designer/projects'
-H 'Authorization: Bearer <token>'
-H 'x-organization-id: <org-id>'
-H 'x-owner-id: <owner-id>'
-H 'accept: application/json'
-H 'Content-Type: application/json'
--data-binary '{"name":"myproject", "classifier":"raml"}'
--compressed
curl 'https://anypoint.mulesoft.com/designcenter/api-designer/projects/<project-id>/branches' -H 'Authorization: Bearer <token>' -H 'x-organization-id: <org-id>' -H 'x-owner-id: <owner-id>' -H 'accept: application/json' --compressed
The <project-id> value is obtained on the response received from step 1.
curl 'https://anypoint.mulesoft.com/designcenter/api-designer/projects/<project-id>/branches/<branch>/acquireLock'
-H 'Authorization: Bearer <token>'
-H 'x-organization-id: <org-id>'
-H 'x-owner-id: <owner-id>'
-H 'accept: application/json'
-H 'Content-Type: application/json'
--data-binary '{}'
--compressed
If you want to modify the base RAML file created automatically with the project on step 1 or to create any additional RAML files, perform the step below.
curl 'https://anypoint.mulesoft.com/designcenter/api-designer/projects/<project-id>/branches/<branch>/save'
-H 'Authorization: Bearer <token>'
-H 'x-organization-id: <org-id>'
-H 'x-owner-id: <owner-id>'
-H 'accept: application/json'
-H 'Content-Type: application/json'
--data-binary '[{"path":"/myproject.raml","type":"FILE","content":"#%RAML 1.0\ntitle: API title"}]'
--compressed
curl 'https://anypoint.mulesoft.com/designcenter/api-designer/projects/<proejct-id>/branches/<branch>/publish/exchange'
-H 'Authorization: Bearer <token>'
-H 'x-organization-id: <org-id>'
-H 'x-owner-id: <owner-id>'
-H 'accept: application/json'
-H 'Content-Type: application/json'
--data-binary '{"name":"MyProjectName", "apiVersion":"'0.1'", "version":"1.0.0", "main":"api.raml", "assetId":"myasset", "groupId":"<group-id>","classifier":"raml"}'
--compressed
<group-id> is represented by your organization id.
Disclaimer: this is provided as a reference for your own usage and it's subject to changes in future API's releases. This will be considered as a custom implementation made by the customer and supported as such
001114885

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.