{"info":{"_postman_id":"4939fed4-ed26-4a19-b706-3c9aa3667376","name":"V.Alexander & Co. eAdaptor Proxy API","description":"<html><head></head><body><p>The V. Alexander eAdaptor Proxy API enables vendors to create secure data integrations with our internal ERP system CargoWise One.</p>\n<p>Unlike traditional RESTful API, V. Alexander eAdaptor Proxy API only uses one single resource endpoint and POST method for all data retrieval, creation, update, and deletion. It is accepting only XML as request body instead of JSON.</p>\n<h1 id=\"getting-started\">Getting started</h1>\n<p>To get started, contact your V. Alexander IT team to obtain credentials and an API key. You will need the following information:</p>\n<ol>\n<li>The email address for the technical contact at your company.</li>\n<li>The IP address (or IP addresses) you will use to send requests to the API.</li>\n</ol>\n<blockquote>\n<p><strong>Note</strong>: Access to the V. Alexander eAdaptor Proxy API is restricted to a list of allowed IP addresses. Please remember to make a note of the originating IP address so we can allow the new traffic.</p>\n</blockquote>\n<h2 id=\"authentication-and-authorization\">Authentication and Authorization</h2>\n<p>The V. Alexander eAdaptor Proxy API uses OAuth 2.0 along with an API key for authentication and authorization. All applications follow a basic pattern when accessing a V.Alexander eAdaptor Proxy API using OAuth 2.0. At a high level, you follow these steps:</p>\n<ol>\n<li>Contact the V.Alexander IT team to obtain your access credentials if you don't have them before continuing.</li>\n<li><strong>Note:</strong> Access tokens expire after 1 hour. Client credentials do not use refresh tokens, and you will need to re-authenticate when your token expires.</li>\n<li>Include the access token and API key with your request.<br> After your application obtains an access token, it should send the token and API Key to the V. Alexander eAdaptor Proxy API in the HTTP request header.<ul>\n<li>Set an <code>\"x-api-key\"</code> header with the value set to your API key.</li>\n<li>Set an <code>\"Authorization\"</code> header with the value set to your access token.</li>\n</ul>\n</li>\n</ol>\n<h2 id=\"scope\">Scope</h2>\n<p>V. Alexander eAdaptor Proxy API controls authenticated access to resource and method with scope. Currently, there is only one scope available for the API: \"eadaptor.write\". Client app may need to provide this scope when obtaining access token.</p>\n<h2 id=\"import-and-test-api-collection-locally-in-postman\">Import and Test API Collection Locally in Postman</h2>\n<p>V. Alexander eAdaptor Proxy API Collection can be imported into your local Postman app for testing. You will need the Postman application to use this feature.</p>\n<ol>\n<li>From this documentation, click <code>Run in Postman</code> and select the workspace to import the collection into.</li>\n<li>Click on the <code>edit</code> option on the imported collection.</li>\n<li>Add the following script into the <code>Pre-request script</code> section and update the <code>clientId</code>, <code>clientSecret</code>, <code>apiKey</code>, and <code>tokenUrl</code> constants. You will have received these data points from V. Alexander as part of the setup process.</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>// update this section\nconst clientId = 'your_client_id';\nconst clientSecret = 'your_client_secret';\nconst apiKey = \"your_api_key\";\nconst tokenUrl = 'token_url';\nconst domain = 'eadaptorproxy.valexanderapis.com';\nconst getTokenRequest = {\n  method: \"POST\",\n  url: tokenUrl,\n  body: {\n    mode: \"urlencoded\",\n    urlencoded: [\n      { key: \"client_id\", value: clientId },\n      { key: \"client_secret\", value: clientSecret },\n      { key: \"grant_type\", value: \"client_credentials\" },\n    ],\n  },\n};\npm.sendRequest(getTokenRequest, (err, response) =&gt; {\n  if (err) {\n    console.log(err);\n  }\n  const jsonResponse = response.json();\n  const newAccessToken = jsonResponse.access_token;\n  pm.environment.set(\"domain\", domain);\n  pm.environment.set(\"api_key\", apiKey);\n  pm.environment.set(\"access_token\", newAccessToken);\n});\n\n</code></pre><p>After you save the script, Postman will automatically authenticate to the API, and you will able to make request to our API.</p>\n<h1 id=\"support\">Support</h1>\n<p>For help regarding accessing the V. Alexander eAdaptor Proxy API, please contact V. Alexander IT. To help us address your request efficiently, please include the following:</p>\n<ul>\n<li>A detailed description of the issue</li>\n<li>The request you made, including the HTTP headers</li>\n<li>The response you received from the API</li>\n</ul>\n<h3 id=\"troubleshooting\">Troubleshooting</h3>\n<h4 id=\"403-forbidden\"><code>403 Forbidden</code></h4>\n<p>If you receive a 403 response, check your IP address to ensure it is the same IP address we allowed during setup. Testing from behind a web VPN will change your IP address, and the API will block your request.</p>\n<p>If receive a <code>5XX</code> error, it implies that we have hit an unexpected errors internally. Please kindly let us know.</p>\n<h1 id=\"api-reference\">API Reference</h1>\n<hr>\n<h3 id=\"5xx-error-responses\">5XX Error responses</h3>\n<p>Despite the V. Alexander eAdaptor Proxy API accepts and returns payload in form of XML, when the API encounters unexpected internal error, it returns response in form of JSON.</p>\n<h4 id=\"example\">Example</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"message\": \"Internal server error\"\n}\n\n</code></pre><p>This means before client tries to parse the response, it is recommended to check for the HTTP status first and determine if the response will be in form of XML or JSON.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Getting started","slug":"getting-started"},{"content":"Support","slug":"support"},{"content":"API Reference","slug":"api-reference"}],"owner":"12752850","collectionId":"4939fed4-ed26-4a19-b706-3c9aa3667376","publishedId":"2s8YsnYcEp","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2023-02-06T20:17:42.000Z"},"item":[{"name":"eadaptor","id":"b96e16c3-d02e-4d66-8c16-fc45bfbf3a27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{access_token}}","type":"text"},{"key":"x-api-key","value":"{{client_id}}","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"xml"}}},"url":"https://{{domain}}/v1/eadaptor?response_file_link=true","description":"<p>Use this resource to interact with CargoWise One resources.</p>\n<p>This endpoint returns responses in 2 different forms depending on the `response_file_link` query string parameter.</p>\n<p>If `response_file_link` is set to `true`, then the element in response will contain a S3 pre-signed link for downloading the response file.</p>\n<p>If `response_file_link` is set to `false` or not present, then element in response will contain CargoWise One response directly.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<ul>\n<li>response_file_link<br />  The flag for controlling the data form in response.<br />  If `response_file_link` is set to `true`, then the element in response will contain a S3 pre-signed link for downloading the response file.<br />  If `response_file_link` is set to `false` or not present, then element n response will contain CargoWise One response directly.</li>\n</ul>\n","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"scope","value":"<scope>"},{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"clientSecret","value":"<client-secret>"},{"key":"clientId","value":"<client-id>"},{"key":"tokenName","value":"<token-name>"},{"key":"challengeAlgorithm","value":"<challenge-algorithm>"},{"key":"grant_type","value":"<grant_type>"},{"key":"client_authentication","value":"<client_authentication>"}]},"isInherited":true,"source":{"_postman_id":"4939fed4-ed26-4a19-b706-3c9aa3667376","id":"4939fed4-ed26-4a19-b706-3c9aa3667376","name":"V.Alexander & Co. eAdaptor Proxy API","type":"collection"}},"urlObject":{"protocol":"https","path":["v1","eadaptor"],"host":["{{domain}}"],"query":[{"key":"response_file_link","value":"true"}],"variable":[]}},"response":[{"id":"153648e4-e50c-439c-8d0d-e950b9e7a343","name":"415 Unsupported Media","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"access_token","type":"text"},{"key":"x-api-key","value":"api_key","type":"text"}],"body":{"mode":"raw","raw":"<UniversalShipmentRequest xmlns=\"http://www.cargowise.com/Schemas/Universal/2011/11\" version=\"1.1\">\n\t<ShipmentRequest>\n\t\t<DataContext>\n\t\t\t<DataTargetCollection>\n\t\t\t\t<DataTarget>\n\t\t\t\t\t<Type>ForwardingShipment</Type>\n\t\t\t\t\t<Key>SBNASVE123456</Key>\n\t\t\t\t</DataTarget>\n\t\t\t</DataTargetCollection>\n\t\t</DataContext>\n\t</ShipmentRequest>","options":{"raw":{"language":"xml"}}},"url":"https://{{domain}}/v1/eadaptor"},"status":"Unsupported Media Type","code":415,"_postman_previewlanguage":"xml","header":[{"key":"Date","value":"Wed, 23 Nov 2022 16:59:02 GMT"},{"key":"Content-Type","value":"application/xml"},{"key":"Content-Length","value":"297"},{"key":"Connection","value":"keep-alive"},{"key":"x-amzn-RequestId","value":"8eda6fb5-6a69-4beb-a66b-68127ad845fe"},{"key":"x-amz-apigw-id","value":"cEGlhFKToAMFUvw="},{"key":"X-Amzn-Trace-Id","value":"Root=1-637e5156-17878a3a3623dc587b8ce6e2"}],"cookie":[],"responseTime":null,"body":"        \n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<UniversalResponse version=\"1.1\" xmlns=\"http://www.cargowise.com/Schemas/Universal/2011/11\">\n    <Status>ERR</Status>\n    <Data />\n    <ProcessingLog>Unclosed tag 'UniversalShipmentRequest'.</ProcessingLog>\n</UniversalResponse>"},{"id":"c1f00be5-35da-4a74-a765-0cd30843b636","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"access_token","type":"text"},{"key":"x-api-key","value":"api_key","type":"text"}],"body":{"mode":"raw","raw":"<UniversalShipmentRequest xmlns=\"http://www.cargowise.com/Schemas/Universal/2011/11\" version=\"1.1\">\n\t<ShipmentRequest>\n\t\t<DataContext>\n\t\t\t<DataTargetCollection>\n\t\t\t\t<DataTarget>\n\t\t\t\t\t<Type>ForwardingShipment</Type>\n\t\t\t\t\t<Key>SBNASVE123456</Key>\n\t\t\t\t</DataTarget>\n\t\t\t</DataTargetCollection>\n\t\t</DataContext>\n\t</ShipmentRequest>\n</UniversalShipmentRequest>","options":{"raw":{"language":"xml"}}},"url":"https://{{domain}}/v1/eadaptor"},"status":"OK","code":200,"_postman_previewlanguage":"xml","header":[{"key":"Date","value":"Wed, 23 Nov 2022 17:00:20 GMT"},{"key":"Content-Type","value":"application/xml"},{"key":"Content-Length","value":"255"},{"key":"Connection","value":"keep-alive"},{"key":"x-amzn-RequestId","value":"168759c5-40a7-4e76-b8b2-9fc237abcbd7"},{"key":"x-amz-apigw-id","value":"cEGxnFxooAMFlXQ="},{"key":"X-Amzn-Trace-Id","value":"Root=1-637e51a3-6a204c1d2c82ef5826200163"}],"cookie":[],"responseTime":null,"body":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<UniversalResponse version=\"1.1\" xmlns=\"http://www.cargowise.com/Schemas/Universal/2011/11\">\n    <Status>PRS</Status>\n    <Data>\n        <UniversalShipment xmlns=\"http://www.cargowise.com/Schemas/Universal/2011/11\" version=\"1.1\">\n            The UniversalShipment XML data goes here\n        </UniversalShipment>\n    </Data>\n    <ProcessingLog />\n</UniversalResponse>"}],"_postman_id":"b96e16c3-d02e-4d66-8c16-fc45bfbf3a27"}],"auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"scope","value":"<scope>"},{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"clientSecret","value":"<client-secret>"},{"key":"clientId","value":"<client-id>"},{"key":"tokenName","value":"<token-name>"},{"key":"challengeAlgorithm","value":"<challenge-algorithm>"},{"key":"grant_type","value":"<grant_type>"},{"key":"client_authentication","value":"<client_authentication>"}]}},"event":[{"listen":"prerequest","script":{"id":"91f6fb89-e26f-41c9-97ba-9dfb7bf38a29","type":"text/javascript","exec":["const tokenUrl = pm.environment.get(\"access_token_url\");","const clientId = pm.environment.get(\"client_id\");","const clientSecret = pm.environment.get(\"client_secret\");","","const getTokenRequest = {","  method: \"POST\",","  url: tokenUrl,","  body: {","    mode: \"urlencoded\",","    urlencoded: [","      { key: \"client_id\", value: clientId },","      { key: \"client_secret\", value: clientSecret },","      { key: \"grant_type\", value: \"client_credentials\" },","    ],","  },","};","","pm.sendRequest(getTokenRequest, (err, response) => {","  if (err) {","    console.log(err);","  }","","  const jsonResponse = response.json();","  const newAccessToken = jsonResponse.access_token;","","  pm.environment.set(\"access_token\", newAccessToken);","});"]}},{"listen":"test","script":{"id":"e782f55b-31b7-4c91-ab4b-f60103fdca42","type":"text/javascript","exec":[""]}}]}