====== GMS API 3.x Postman script ====== Postman is a RESTfull client that can be used to perform http requests to the WMC through GMS API. \\ You can find information about GMS API in the [[.documentation|Documentation]] section of the dashboard. Kerlink provides a sample Postman configuration dump that can be imported. It contains: * One environment: that defines a WMC instance used for integration tests, username and password. * One authentication collection: that contains the login webservice, retrieves and stores the authentication token in an environment variable. * One large WMC collection: that contains all the web services, all the requests that you can perform to the WMC 3.x. ===== Installation ===== **For WMC 3.x:** - Install [[https://www.getpostman.com/downloads/|Postman]], if not already installed (please choose the standalone application, not the browser extension). **For WMC 3.0:** - Download {{wiki3:postman_environment.json|the Postman environment}}. This file contains the WMC base URL (which may need to be changed) and the username/password (which definitely need to be changed). - Download {{wiki3:collection_3.0.2.json|the requests collection}}. This file contains templates for all the web services. - Import the downloaded JSON files (step 1 and 2). **For WMC 3.1:** - Export the GMS API JSON OpenAPI file from the WMC dahsboard. - Import the JSON file in the Postman working area. **For WMC 3.x:** - Edit the environment to match your needs (credentials and WMC instance URL). - Execute the authentication request: this will save the authentication token in the environment (open the environment again to check). - Edit the collection variables, and set your customer''id'' (for example). - Execute a request that uses the customer''id'' variable, for example ''getCustomer''. ===== Screenshots ===== Here are the screenshots of the steps mentioned above. **Import the GMSAPI file** \\ **For WMC 3.0:**\\ We need to import the Postman dump file: \\ {{:wiki3:postman_environnement_import_wmc_3.0_1.png?800|}} \\ {{:wiki3:postman_environnement_import_wmc_3.0_2.png?400|}} **For WMC 3.1:** \\ We need to import the OpenAPI.json file: \\ {{:wiki3:postman_environnement_export_openapi_json.png?800|}} \\ {{:wiki3:postman_environnement_import_wmc_3.1.png?800|}} **Setup your environment** \\ Enter your login/password, and change URL if needed. \\ The auth token will be populated automatically when performing a login request. \\ {{:wiki3:postman_authentication_wmc_3.0.png?800|}} **Perform an authentication** \\ This will create a session that lasts 16 hours. \\ {{:wiki3:postman_authentication_login_wmc_3.0.png?800|}} **Edit collection menu** \\ {{:wiki3:postman_collection_edit_wmc_3.0.png?800|}} \\ {{:wiki3:postman_collection_edit2_wmc_3.0.png?800|}} **Collection variables** \\ You can change the variables that are used in the requests \\ {{:wiki3:postman_getcustomer_def_id_wmc_3.0.png?800|}} \\ {{:wiki3:postman_getcustomer_view_id_wmc_3.0.png?800|}} **Request execution** \\ See the variables used and the request result \\ {{:wiki3:postman_getcustomer_execute_wmc_3.0.png?800|}}