Welcome to the IBM TechXchange Community, a place to collaborate, share knowledge, & support one another in everyday challenges. Connect with your fellow members through forums, blogs, files, & face-to-face networking.
Join / sign up
Hi, Following up on my blog about getting started using the API Connect v10 REST API calls ( here ) I thought I would share some calls around the API Lifecycle that might be of interest. All the calls for the API Connect v10 Provider-API are described here https://apic-api.apiconnect.ibmcloud.com/v10/#/IBMAPIConnectPlatformProviderAPI 200/overview but I will list some useful calls around the API Lifecycle from the Provider-API in this blog: Here $mgmt-url is the URL for the API Manager (you can get all you credentials from the API Manager's "Download Toolkit" tile) and $b is the Bearer Token generated based on those credentials (see my getting started blog for details). Get IDs for all Draft APIs & Products from a Provider Organization in API Manager by listing all the details: curl -v -k -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts Use those IDs to get details of specific APIs & Products from the API Manager Drafts: curl -v -k -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts/draft-apis/<API-ID> curl -v -k -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts/draft-apis/<API-ID>/document curl -v -k -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts/draft-products/<PRODUCT-ID> curl -v -k -X GET -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts/draft-products/<PRODUCT-ID>/document Get all Products from a Catalog: curl -v -k -X GET -H 'Accept: application/json' -H "Authorization: bearer $b" https://$mgmt-url/api/catalogs/(org)/(catalog)/products Create a Draft API (using API yaml/json) in your API Manager Provider Organization: curl -v -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts/draft-apis --data-raw '("draft api":("swagger":"2.0","info":("title":"theAPI","x-ibm-name":"theapi","version":"v1.0"),"schemes":["https"],"basePath":"/theapi","security":[("clientID":[])],"securityDefinitions":("clientID":("type":"apiKey","in":"header","name":"X-IBM-Client-Id")),"x-ibm-configuration":("phase":"realized","testable":true,"enforced":true,"properties":("target-url":("value":"https://randomuser.me/api","description":"The URL of the target service","encoded":false)),"catalogs":(),"cors":("enabled":true),"application-authentication":("certificate":false),"assembly":("execute":[("invoke":("title":"invoke","version":"2.0.0","verb":"keep","target-url":"$(target-url)"))]),"gateway":"datapower-api-gateway","type":"rest"),"paths":("/getTestResults":("get":("responses":("200":("description":"Success!","schema":("type":"object"))),"consumes":[],"produces":[])))))' Create a Draft Product (using API yaml/json & containing the Draft API created above) in your API Manager Provider Organization: curl -v -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/orgs/(org)/drafts/draft-products --data-raw '("draft product":("info":("version":"1.0.0","title":"theProduct","name":"theproduct"),"gateways":["datapower-api-gateway"],"plans":("default-plan":("title":"Default Plan","description":"Default Plan","rate-limits":("default":("value":"100/1hour")))),"apis":("theapiv1.0":("name":"theapi:v1.0")),"visibility":("view":("type":"public","orgs":[],"tags":[],"enabled":true),"subscribe":("type":"authenticated","orgs":[],"tags":[],"enabled":true)),"product":"1.0.0"))' Publish Products to promote to different Catalogs (Dev -> Test -> Prod): curl -v -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/catalogs/(org)/dev/publish-draft-product --data-raw '("draft product url":"$mgmt-url/api/orgs/(org)/drafts/draft-products/(product-id)")' curl -v -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/catalogs/(org)/test/publish-draft-product --data-raw '("draft product url":"$mgmt-url/api/orgs/(org)/drafts/draft-products/(product-id)")' curl -v -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: bearer $b" $mgmt-url/api/catalogs/(org)/prod/publish-draft-product --data-raw '("draft product url":"$mgmt-url/api/orgs/(org)/drafts/draft-products/(product-id)")' Publish a Product, from a file, direct to the Catalog bypassing creation in Drafts (run from the same directory as the files or use absolute paths as reference): curl -v -k -X POST $mgmt-url /api/catalogs/ (org)/(catalog) /publish -H 'Accept: application/json' -H "Authorization: Bearer $b" -H "content-type: multipart/form-data" -F "product=@theproduct 1.0.0.yaml;type=application/yaml" -F "openapi=@theapi 1.0.0.yaml;type=application/yaml" Publish a Product, from a file, direct to the Catalog bypassing creation in Drafts with APIs which include WSDLs: curl -v -k -X POST $mgmt-url/api/catalogs/(org)/(catalog)/publish -H 'Accept: application/json' -H "Content-Type: multipart/form-data" -H "Authorization: Bearer $b" -F "product=@/directory/file/location/fromwsdlProduct 1.0.0.yaml;type=application/yaml" -F "openapi=@/directory/file/location/fromwsdlAPI 1.0.0.yaml;type=application/yaml" -F "wsdl=@/directory/file/location/Client-backend-system-WSDL.wsdl;type=application/wsdl" Deprecate a Product (see above to get IDs): curl -v -k -X PATCH -H 'Accept: application/json' -H 'content-type: application/json' -H "Authorization: bearer $b" -d '("state": "deprecated")' https://$mgmt-url/api/catalogs/(org)/(catalog)/products/<PRODUCT-ID> Retire a Product (see above to get IDs): curl -v -k -X PATCH -H 'Accept: application/json' -H 'content-type: application/json' -H "Authorization: bearer $b" -d '("state": "retired")' https://$mgmt-url/api/catalogs/(org)/(catalog)/products/<PRODUCT-ID> Archive a Product (see above to get IDs): curl -v -k -X PATCH -H 'Accept: application/json' -H 'content-type: application/json' -H "Authorization: bearer $b" -d '("state": "archived")' https://$mgmt-url/api/catalogs/(org)/(catalog)/products/<PRODUCT-ID> Delete an API or Product from Drafts (see above to get IDs): curl -v -k -X DELETE -H 'Accept: application/json' -H "Authorization: bearer $b" https://$mgmt-url/api/orgs/(org)/drafts/draft-apis/<API-ID> curl -v -k -X DELETE -H 'Accept: application/json' -H "Authorization: bearer $b" https://$mgmt-url/api/orgs/(org)/drafts/draft-products/<PRODUCT-ID> I hope you find this guide useful. -- Nick Cawood API Connect Consultant IBM Hybrid Cloud Integration Expert Labs IBM UK Ltd https://www.linkedin.com/in/nickcawood/ -- #APIConnect
12 Comments - API Connect v10.0.5.0...@ Vyasavardhan Ramagiri The form data is the Open API spec for your API and the associated Product
The Maximo REST API is continually evolving as its usage expands. See the Maximo Nextgen PDF document which contains the full documented features of the API #REST #JSON API #OSLC API #AssetandFacilitiesManagement #Integration #MaximoIntegrationandScripting #Maximo
6 attachments
See matching library entry files - Maximo_REST_API_Guide.pdf
3 Comments - no search term matches found in comments.
See matching posts in thread - API...Hi, I need to know how to de...
See matching posts in thread - CPLEX API Performance: C ...
Table of Contents REST Endpoints vs WebSocket Endpoints Denial-of-Service Attacks Rate Limits Count Limits Creating a secure WebSocket API from a target service Creating a secure WebSocket and HTTPS API from a target service Example API and Product YAMLs REST Endpoints vs WebSocket Endpoints Traditional REST endpoints allow only a single request to be sent and a single response to be received
See matching posts in thread - ADP-API Validator
See matching posts in thread - API Analytics - API...
In API Connect, users can be onboarded in two ways: User Invitations : where a user is sent an invitation to either create and own an organization/catalog/space/consumer-org OR join as a member at one of these scopes
See matching posts in thread - API RateLimit Enforcement Metri...
Creating an API Gateway using the UI. An API gateway provides a single, unified API entry point across one or more internal APIs. You can use it to create, secure, share, and manage APIs that access IBM Cloud resources. When a client makes a request, the API gateway intercepts an incoming API call and executes security policies, and then routes the call to the backend application