{ "info": { "_postman_id": "63520d92-cbe1-4efa-b8be-361cc8dca8d7", "name": "VismaNet Requests", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Generate Access Token", "request": { "auth": { "type": "oauth2", "oauth2": [ { "key": "clientSecret", "value": "{{VismaClientSecret}}", "type": "string" }, { "key": "clientId", "value": "{{VismaClientId}}", "type": "string" }, { "key": "client_authentication", "value": "body", "type": "string" }, { "key": "grant_type", "value": "authorization_code", "type": "string" }, { "key": "password", "value": "posh0hagh4WHAC*klaf", "type": "string" }, { "key": "username", "value": "frank.haugen@semine.no", "type": "string" }, { "key": "authUrl", "value": "{{BaseUrl}}/resources/oauth/authorize", "type": "string" }, { "key": "useBrowser", "value": false, "type": "boolean" }, { "key": "state", "value": "{{State}}", "type": "string" }, { "key": "scope", "value": "{{Scope}}", "type": "string" }, { "key": "accessTokenUrl", "value": "{{BaseUrl}}/security/api/v2/token", "type": "string" }, { "key": "redirect_uri", "value": "{{RedirectUrl}}", "type": "string" }, { "key": "tokenName", "value": "VismaNetToken", "type": "string" }, { "key": "addTokenTo", "value": "header", "type": "string" } ] }, "method": "GET", "header": [] }, "response": [] }, { "name": "Companies", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "pm.request.headers.upsert({key: \"Content-Type\", value: \"application/json\"});\r", "pm.request.headers.upsert({key:\"ipp-application-type\", value:\"Visma.net Financials\"});\r", "pm.request.headers.upsert({key:\"Accept\", value:\"application/json\"});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/json" }, { "key": "ipp-company-id", "value": "3972166", "type": "text" }, { "key": "ipp-application-type", "value": "Visma.net Financials", "type": "text" }, { "key": "Accept", "value": "application/json", "type": "text" } ], "url": { "raw": "{{BaseUrl}}/resources/v1/context", "host": [ "{{BaseUrl}}" ], "path": [ "resources", "v1", "context" ] } }, "response": [] }, { "name": "Company", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "pm.request.headers.upsert({key: \"Content-Type\", value: \"application/json\"});\r", "pm.request.headers.upsert({key:\"ipp-application-type\", value:\"Visma.net Financials\"});\r", "pm.request.headers.upsert({key:\"Accept\", value:\"application/json\"});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/json" }, { "key": "ipp-company-id", "value": "3972166", "type": "text" }, { "key": "ipp-application-type", "value": "Visma.net Financials", "type": "text" }, { "key": "Accept", "value": "application/json", "type": "text" } ], "url": { "raw": "{{BaseUrl}}/resources/v1/context/{{CompanyId}}", "host": [ "{{BaseUrl}}" ], "path": [ "resources", "v1", "context", "{{CompanyId}}" ] } }, "response": [] }, { "name": "Organizations", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "let companyId = pm.environment.get('CompanyId');\r", "\r", "pm.request.headers.upsert({key: \"Content-Type\", value: \"application/json\"});\r", "pm.request.headers.upsert({key:\"ipp-company-id\", value:companyId});\r", "pm.request.headers.upsert({key:\"ipp-application-type\", value:\"Visma.net Financials\"});\r", "pm.request.headers.upsert({key:\"Accept\", value:\"application/json\"});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/json" }, { "key": "ipp-company-id", "value": "3972166", "type": "text" }, { "key": "ipp-application-type", "value": "Visma.net Financials", "type": "text" }, { "key": "Accept", "value": "application/json", "type": "text" } ], "url": { "raw": "{{ErpApi}}/organization", "host": [ "{{ErpApi}}" ], "path": [ "organization" ] } }, "response": [] }, { "name": "Payment Method", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "let companyId = pm.environment.get('CompanyId');\r", "\r", "pm.request.headers.upsert({key: \"Content-Type\", value: \"application/json\"});\r", "pm.request.headers.upsert({key:\"ipp-company-id\", value:companyId});\r", "pm.request.headers.upsert({key:\"ipp-application-type\", value:\"Visma.net Financials\"});\r", "pm.request.headers.upsert({key:\"Accept\", value:\"application/json\"});" ], "type": "text/javascript" } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/json" }, { "key": "ipp-company-id", "value": "3972166", "type": "text" }, { "key": "ipp-application-type", "value": "Visma.net Financials", "type": "text" }, { "key": "Accept", "value": "application/json", "type": "text" } ], "url": { "raw": "{{ErpApi}}/paymentmethod", "host": [ "{{ErpApi}}" ], "path": [ "paymentmethod" ] } }, "response": [] } ], "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{AccessToken}}", "type": "string" } ] }, "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }