CINXE.COM

Lufthansa Cargo Developer Portal - Shipment Tracking Subscribe

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="P3Pv1" href="/w3c/p3p.xml" /> <link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@boomi/exosphere@3.0.0/dist/styles.css' /> <script type="text/javascript" > var csp = ''; var nonce = '86583532cd716624afd8'; //<![CDATA[ var mashery_info = { }; // iframe'd detection, to pop out if in an iframe if (window.location !== parent.window.location && !(/(page|docs|blog)\/preview/.test(window.location.pathname))) { parent.window.location = window.location; } //]]> </script> <title>Lufthansa Cargo Developer Portal - Shipment Tracking Subscribe</title> <link rel="alternate" type="application/rss+xml" href="https://developer.lufthansa-cargo.com/docs/feed-comments/apis/shipmenttrackingsubscribe" /> <link rel="stylesheet" type="text/css" media="screen" href="/files/LufthansaCargo.CSS" /> <script src="/public/Mashery/scripts/themes/blackbeard/placeholders.js" type="text/javascript"></script> <script src="/public/Mashery/scripts/Mashery/source/ForumPreview.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ </script> <link rel="stylesheet" type="text/css" href="/files/font.css"> <script> //]]> </script> <!-- add syntax highlighter --> <script type="text/javascript" > if(window.SyntaxHighlighter != undefined) { // check for syntax highlighter load before using SyntaxHighlighter.all(); } </script> <!-- end syntax highlighter --> <!--[if lt IE 7.]> <link href="/public/Mashery/styles/IE6.css" type="text/css" media="screen" rel="stylesheet" /> <![endif]--> <!--[if IE 7]> <link href="/public/Mashery/styles/IE7.css" type="text/css" media="screen" rel="stylesheet" /> <![endif]--> <!--[if gte IE 8]> <link href="/public/Mashery/styles/IE8.css" type="text/css" media="screen" rel="stylesheet" /> <![endif]--> </head> <body id="page-docs" class="page-docs read en_US"> <!-- PAGE --> <div id="page" class="page read"> <!-- HEADER --> <div id="header" class="header"> <div id="branding" class="branding"> <div id="branding-logo" class="branding-logo"> Lufthansa Cargo Developer Portal </div><!-- /branding-logo --> <div id="branding-tagline"> </div><!-- /branding-tagline --> <!--div id="branding-mashery"></div --><!-- /branding-mashery --> </div><!-- /branding --> <div id="search" class="search"> <form id="search-input" class="search-input" method="get" action="/search"> <div> <input id="search-box" class="search-box" type="text" value="" name="q" /> <input id="search-button" class="search-button" type="submit" value="Search" /> </div> </form> </div> </div> <!-- /HEADER --> <div id="user" class="user"> <div id="user-auth" class="user-auth"> </div><!-- /user-auth --> <div id="user-main" class="user-main"> </div><!-- /user-main --> <div id="user-nav" class="user-nav"> <ul> <script > window. addEventListener('load', (event) => { var lastSignOut = document.getElementById("lastSignOut"); if(lastSignOut) { lastSignOut.addEventListener("click", function () { document.getElementById('mashery-logout-form').submit(); }); } }); </script> <li class="first sign-in"> <a href="https://developer.lufthansa-cargo.com/login/login?r=https%3A%2F%2Fdeveloper.lufthansa-cargo.com%2Fdocs%2Fread%2Fapis%2Fshipmenttrackingsubscribe&amp;h=a7726fcd6a622ced25a6443376814223">Sign In</a> </li> <li class="register"> <a href="https://developer.lufthansa-cargo.com/member/register">Register</a> </li> </ul> </div><!-- /user-nav --> <div id="user-menu"> </div> </div><!-- /user --> <div id="info" class="info" style="display: none;"> </div><!-- /info --> <!-- CONTENT --> <div id="content" class="content"> <div id="main" class="main"> <ul class="pun-nav last"><li class="previous"><span class="label">Previous:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis/shipmenttracking">Shipment Tracking</a></li><li class="up"><span class="label">Up:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis">Public APIs</a></li><li class="next"><span class="label">Next:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis/routingoffer">Routing Offer</a></li></ul> <h1 class="first">Shipment Tracking Subscribe</h1> <div class="section"> <div class="section-body"> <p>The Shipment Tracking Subscribe API enables you to receive automatic updates on the status of a shipment. You may subscribe for a selected AWB and every time the shipment reaches a new milestone you will be automatically notified via the API.</p> <p>The structures&nbsp;of all-sub-services of the Station Information API are defined in a Swagger. You can find the respective Swagger in our&nbsp;<a href="/io-docs">Interactive API</a>.</p> <h1>Create a subscription</h1> <p>Create a subscription per AWB number for which you would like to get automatic tracking status updates.</p> <h2>Prerequisites</h2> <p>Prior to the creation of a subscription, we will call your provided callback URL with an&nbsp;<strong>HTTP OPTIONS</strong>&nbsp;call.</p> <p>In the response, we require the&nbsp;<strong>HTTP Allow Header&nbsp;</strong>which allows a HTTP POST to this endpoint.&nbsp;</p> <p>e.g.</p> <pre>Request: &gt; OPTIONS https://yoursoftwaresolution.com/lufthansacargo/trackingCallback &gt; ... Response: &lt; ... &lt; Allow: OPTIONS, GET, HEAD, POST &lt; ... </pre> <h2>Request URI</h2> <pre>POST https://api.lufthansa-cargo.com/lh/handling/shipment/subscribe</pre> <h2>Request Body</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>awb</em></td> <td>The Air Waybill Number (AWB)</td> <td>AWB prefix: 3-digit : [0-9]{3} e.g. 020<br />AWB number: 8-digit [0-9]{8} e.g. 08002050</td> </tr> <tr> <td><em>callback</em></td> <td>The callback URL from your system. Please note that you must inform which Callback URLs you want to use</td> <td>String</td> </tr> <tr> <td><em>states</em></td> <td>AWB status you are interested in.<br />Possible Values:<br />* (all changes), RCS (shipment physically received from shipper/ agent), MAN (shipment manifested on flight), DEP (shipment departed on flight), ARR (shipment arrived from flight), RCF (shipment physically received from flight), NFD (agent/consignee informed of shipment arrival), DLV (shipment delivered to agent/ consignee), DDL (shipment delivered to the consignee&rsquo;s door), RCT (shipment received from another airline), TFD (shipment transferred to another airline), DIS (discrepancy: offload, shortshipped, missing cargo or found cargo), TOA (TOA change information)</td> <td>String</td> </tr> </tbody> </table> <h2>Response body</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>subscriptionId</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> <tr> <td><em>AWB</em></td> <td>The Air Waybill Number (AWB)</td> <td>AWB prefix: 3-digit : [0-9]{3} e.g. 020<br />AWB number: 8-digit [0-9]{8} e.g. 08002050</td> </tr> <tr> <td><em>Callback</em></td> <td>The callback URL from your system. Please note that you must inform which Callback URLs you want to use</td> <td>String</td> </tr> <tr> <td><em>States</em></td> <td>AWB status you are interested in.<br />Can be: * (all changes), RCS (shipment physically received from shipper/ agent), MAN (shipment manifested on flight), DEP (shipment departed on flight), ARR (shipment arrived from flight), RCF (shipment physically received from flight), NFD (agent/consignee informed of shipment arrival), DLV (shipment delivered to agent/ consignee), DDL (shipment delivered to the consignee&rsquo;s door), RCT (shipment received from another airline), TFD (shipment transferred to another airline),&nbsp;TOA (TOA change information)</td> <td>String</td> </tr> </tbody> </table> <h1>Get subscription details</h1> <p>You can get the details for a given subscription</p> <h2>Request URI</h2> <pre>GET https://api.lufthansa-cargo.com/lh/handling/shipment/subscribe/{subscriptionId}</pre> <h2>Request parameters</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>{subscriptionId}</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> </tbody> </table> <h2>Response body</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>subscriptionId</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> <tr> <td><em>AWB</em></td> <td>The Air Waybill Number (AWB)</td> <td>AWB prefix: 3-digit : [0-9]{3} e.g. 020<br />AWB number: 8-digit [0-9]{8} e.g. 08002050</td> </tr> <tr> <td><em>Callback</em></td> <td>The callback URL from your system. Please note that you must inform which Callback URLs you want to use</td> <td>String</td> </tr> <tr> <td><em>States</em></td> <td>AWB status you are interested in.<br />Can be: * (all changes), RCS (shipment physically received from shipper/agent), MAN (shipment manifested on flight), DEP (shipment departed on flight), ARR (shipment arrived from flight), RCF (shipment physically received from flight), NFD (agent/consignee informed of shipment arrival), DLV (shipment delivered to agent/consignee), DDL (shipment delivered to the consignee&rsquo;s door), RCT (shipment received from another airline), TFD (shipment transferred to another airline), TOA (TOA change information)</td> <td>String</td> </tr> </tbody> </table> <h1>Update a subscription</h1> <p>You can update the subscription.</p> <h2>Request URI</h2> <pre>PUT https://api.lufthansa-cargo.com/lh/handling/shipment/subscribe/{subscriptionId}&nbsp;</pre> <h2>Request parameter</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>{subscriptionId}</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> </tbody> </table> <h3>Request body</h3> <div class="table-responsive"> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>subscriptionId</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> <tr> <td><em>AWB</em></td> <td>The Air Waybill Number (AWB)</td> <td>AWB prefix: 3-digit : [0-9]{3} e.g. 020<br />AWB number: 8-digit [0-9]{8} e.g. 08002050</td> </tr> <tr> <td><em>Callback</em></td> <td>The callback URL from your system. Please note that you must inform which Callback URLs you want to use</td> <td>String</td> </tr> <tr> <td><em>States</em></td> <td>AWB Status you are interested in.<br />Can be: * (all changes), RCS (shipment physically received from shipper/ agent), MAN (shipment manifested on flight), DEP (shipment departed on flight), ARR (shipment arrived from flight), RCF (shipment physically received from flight), NFD (agent/consignee informed of shipment arrival), DLV (shipment delivered to agent/ consignee), DDL (shipment delivered to the consignee&rsquo;s door), RCT (shipment received from another airline), TFD (shipment transferred to another airline), TOA (TOA change information)</td> <td>String</td> </tr> </tbody> </table> </div> <h2>Response body</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>subscriptionId</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> <tr> <td><em>AWB</em></td> <td>The Air Waybill Number (AWB)</td> <td>AWB prefix: 3-digit : [0-9]{3} e.g. 020<br />AWB number: 8-digit [0-9]{8} e.g. 08002050</td> </tr> <tr> <td><em>Callback</em></td> <td>The callback URL from your system. Please note that you must inform which Callback URLs you want to use</td> <td>String</td> </tr> <tr> <td><em>States</em></td> <td>AWB Status you are interested in.<br />Can be:* (all changes), RCS (shipment physically received from shipper/ agent), MAN (shipment manifested on flight), DEP (shipment departed on flight), ARR (shipment arrived from flight), RCF (shipment physically received from flight), NFD (agent/consignee informed of shipment arrival), DLV (shipment delivered to agent/ consignee), DDL (shipment delivered to the consignee&rsquo;s door), RCT (shipment received from another airline), TFD (shipment transferred to another airline), TOA (TOA change information)</td> <td>String</td> </tr> </tbody> </table> <h1>Delete a subscription</h1> <p>You can delete a subscription in case you no longer need it</p> <h2>Request URI</h2> <pre>DELETE https://api.lufthansa-cargo.com/lh/handling/shipment/subscribe/{subscriptionId}&nbsp;</pre> <h2>Request parameters</h2> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>{subscriptionId}</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> </tbody> </table> <h2>Response</h2> <p>In case your request was processed correctly, you will receive a HTTP status code</p> <pre>204 - no content</pre> <h1>What we will send you</h1> <p>As soon as an update for your subscribed AWB is available, we will POST this JSON to your callback URL. Then you should call the ShipmentTracking API to get full shipment status.</p> <p>In rare cases the push notification is faster then the processing in ShipmentTracking API, so that the ShipmentTracking API returns the status before (old status). We recommend to wait few seconds, f.e. 10s, after the push notification and then call ShipmentTracking API. Also we recommend after creating a booking to wait 10s and then create a subscription.&nbsp;</p> <table> <thead> <tr> <th>Variable</th><th>Description</th><th>Format</th> </tr> </thead> <tbody> <tr> <td><em>subscriptionId</em></td> <td>UUIDv4 of the subscription</td> <td>String</td> </tr> <tr> <td><em>AWB</em></td> <td>The Air Waybill Number</td> <td>AWB prefix: 3-digit : [0-9]{3} e.g. 020<br />AWB number: 8-digit [0-9]{8} e.g. 08002050</td> </tr> <tr> <td><em>State</em></td> <td>AWB State you are interested in.<br />Can be: * (all changes), RCS (shipment physically received from shipper/ agent), MAN (shipment manifested on flight), DEP (shipment departed on flight), ARR (shipment arrived from flight), RCF (shipment physically received from flight), NFD (agent/consignee informed of shipment arrival), DLV (shipment delivered to agent/ consignee), DDL (shipment delivered to the consignee&rsquo;s door), RCT (shipment received from another airline), TFD (shipment transferred to another airline), TOA (TOA change information)</td> <td>String</td> </tr> <tr> <td><em>toaTimestamp</em></td> <td>In case the AWB receives a new TOA (state=TOA), this field will be filled with the new TOA</td> <td>Timestamp or&nbsp;<code>NULL</code></td> </tr> <tr> <td><em>timestamp</em></td> <td>Timestamp when the API backend receives the status event notification</td> <td>Timestamp</td> </tr> </tbody> </table> </div> <div class="section-meta"> <p> <span class="revision">version 10</span> <span class="timestamp">as of <abbr title="10/11/24 6:50 am">1 month ago</abbr></span> <span class="moniker">by <span class="user-reference">Florian Goertz</span></span></p> </div> <ul class="pun-nav last"><li class="previous"><span class="label">Previous:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis/shipmenttracking">Shipment Tracking</a></li><li class="up"><span class="label">Up:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis">Public APIs</a></li><li class="next"><span class="label">Next:</span> <a href="https://developer.lufthansa-cargo.com/docs/read/apis/routingoffer">Routing Offer</a></li></ul> </div> <div class="comments"> <h3> 0 Comments </h3> <p><a href="https://developer.lufthansa-cargo.com/login/login?r=https%3A%2F%2Fdeveloper.lufthansa-cargo.com%2Fdocs%2Fread%2Fapis%2Fshipmenttrackingsubscribe&amp;h=a7726fcd6a622ced25a6443376814223">Please sign in to post a comment.</a></p> </div> </div><!-- /main --> <!-- SUB --> <div id="sub" class="sub"> <h2>Docs Navigation</h2> <ul> <li class="active"><a href="https://developer.lufthansa-cargo.com/docs/read/Home">Lufthansa Cargo API Portfolio and its functionalities</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/howtoconnect">How to connect</a></li> <li class="active"><a href="https://developer.lufthansa-cargo.com/docs/read/apis">Public APIs</a><ul> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/shipmenttracking">Shipment Tracking</a></li> <li class="active"><a href="https://developer.lufthansa-cargo.com/docs/read/apis/shipmenttrackingsubscribe" class="active">Shipment Tracking Subscribe</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/routingoffer">Routing Offer</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/apis/stationinformation">Station Information</a></li> </ul> </li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis">Prior Agreement APIs</a><ul> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis/uldstatus">ULD Status</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis/smartbooking">smartBooking</a></li> <li><a href="https://developer.lufthansa-cargo.com/docs/read/prioragreementapis/onerecord">ONE Record</a></li> </ul> </li> </ul> </div> <!-- /SUB --> <div id="breadcrumbs"> </div><!-- /breadcrumbs --> <div id="local" class="local"> <ul> <li class=" first"><a href="https://developer-test.lufthansa-cargo.com/">Developer Portal Test</a></li> <li class="active "><a href="https://developer.lufthansa-cargo.com/docs">Overview APIs</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/docs/read/howtoconnect">How to connect</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/io-docs">Interactive API</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/news">News</a></li> <li class=" last"><a href="https://developer.lufthansa-cargo.com/contact">Contact</a></li> </ul> </div><!-- /local --> <div id="nav" class="nav"> </div><!-- /nav --> </div> <!-- /CONTENT --> <div id="footer" class="footer"> <ul> <li class=" first"><a href="https://developer.lufthansa-cargo.com/contact">Contact Us</a></li> <li class=" "><a href="https://developer.lufthansa-cargo.com/termsandconditions">Terms</a></li> <li class=" "><a href="https://lufthansa-cargo.com/footer/bottomnav/imprint">Imprint</a></li> <li class=" last"><a href="https://lufthansa-cargo.com/footer/bottomnav/privacy">Privacy</a></li> </ul> <!-- SITEINFO --> <div id="siteinfo" class="siteinfo"> </div> <!-- /SITEINFO --> </div><!-- /footer --> </div> <!-- /page --> <!-- Start Branding script tag --> <script type="text/javascript" > // get the branding logo to set the mouseover/out and onclick var brandingLogo = document.getElementById('branding-logo'); if(brandingLogo != undefined) { brandingLogo.addEventListener("click", function () { location.href = "https://developer.lufthansa-cargo.com/"; }); brandingLogo.addEventListener("mouseover", function () { this.style.cursor = 'pointer'; }); brandingLogo.addEventListener("mouseout", function () { this.style.cursor = 'auto'; }); } // get the mashery logo to set the mouseover/out and onclick var masheryLogo = document.getElementById('branding-mashery'); if(masheryLogo != undefined) { masheryLogo.addEventListener("click", function () { location.href = "http://www.mashery.com/"; }); masheryLogo.addEventListener("mouseover", function () { this.style.cursor = 'pointer'; }); masheryLogo.addEventListener("mouseout", function () { this.style.cursor = 'auto'; }); } </script> <!-- End Branding script tag --> <!-- <div id="extra1">&nbsp;</div> <div id="extra2">&nbsp;</div> --> <script type="text/javascript" > const enableBoomiTheme = 0; window.isOidcUser = 0; </script> <script type="text/javascript" src="/public/Mashery/scripts/themes/blackbeard/app.js"></script> <script type="text/javascript"> //<![CDATA[ /*! * Templates & Initializations * lufthansa-cargo v2.0.0 * Portal Theme Starter Kit v2.10.0 - Default Theme * http://github.com/mashery/portal-theme-starter-kit */ /** * Theme Templates */ // Enable full width layouts window.portalOptions.templates.page = function() { return '<div class="main container container-small content" id="main">' + (mashery.globals.noHeading ? '' : '<h1>{{content.heading}}</h1>') + '{{content.main}}' + '</div>'; }; // Add theme style hook document.documentElement.className += ' js-theme-default'; // Logo portalOptions.logo = '<img alt="Lufthansa Cargo Developer Program" height="36" width="300" src="/files/logoNeu.png">'; // Favicon portalOptions.favicon = true; portalOptions.faviconSizes = '16x16 24x24 32x32 64x64'; /** * Initialize plugins */ window.addEventListener('portalAfterRender', function() { // Expand-and-collapse nav on small viewports astro.init(); // Enhanced documentation if (mashery.globals.betterDocs) { new BetterDocs('.content', { langs: [{ selector: 'bash', title: 'Bash' }, { selector: 'javascript, js', title: 'JavaScript', }, { selector: 'ruby', title: 'Ruby' }, { selector: 'python', title: 'Python' } ], langDefault: 'js', wideLayout: !mashery.globals.betterDocsOneColumn, }); } // Responsive iFrame Videos fluidvids.init({ selector: ['iframe', 'object'], // runs querySelectorAll() players: ['www.youtube.com', 'player.vimeo.com'] // players to support }); // Get the latest blog posts latestBlogPosts(); }, false); // // Record customer terms accepted on user registration // function getRequiredRegistrationTextFields() { // List of required text fields var requiredRegistrationTextFields = ["members-handle", "members-moniker", "members-email", "email_again", "passwd_new", "passwd_again", "applications-name" ]; return requiredRegistrationTextFields; } // All custom fields complete function isFormComplete() { var requiredRegistrationTextFields = getRequiredRegistrationTextFields(); for (var field = 0; field < requiredRegistrationTextFields.length; field++) { var textField = document.getElementById(requiredRegistrationTextFields[field]); if (!textField.value) { return false; } } var customerTerms = document.getElementById("customerTerms").checked; var masheryTerms = document.getElementById("masheryTerms").checked; var shipmentTrackingSubscribe = document.getElementById("shipmentTrackingSubscribe").checked; //CS7608 // var oneRecordAPIIdentityProvider = document.getElementById("oneRecordAPIIdentityProvider").checked; // var oneRecordAPIURI = document.getElementById("oneRecordAPIURI").checked; var oneRecordAPI = document.getElementById("oneRecordAPI").checked; // if (customerTerms && masheryTerms && (!shipmentTrackingSubscribe || ( // shipmentTrackingSubscribe && document.getElementById("applications-shipment_tracking_sub_callback") // .value))) { // return true; // } else { // return false; // } //CS7608 // if (customerTerms && masheryTerms && // (!shipmentTrackingSubscribe || ( shipmentTrackingSubscribe && document.getElementById("applications-shipment_tracking_sub_callback").value)) && // (!oneRecordAPIIdentityProvider || (oneRecordAPIIdentityProvider && document.getElementById("applications-recordapi_idpissuer_sub_callback").value && document.getElementById("applications-recordapi_idppuburl_sub_callback").value)) && // (!oneRecordAPIURI || (oneRecordAPIURI && document.getElementById("applications-recordapi_recorduri_sub_callback").value)) // ) { // return true; // } else { // return false; // } // CS7608 Customers wants to make other fields (idppuburl,idpissuer ) of OneRecordAPI optional // (!oneRecordAPI || (oneRecordAPI && document.getElementById("applications-recordapi_idpissuer_sub_callback").value && document.getElementById("applications-recordapi_idppuburl_sub_callback").value) && document.getElementById("applications-recordapi_recorduri_sub_callback").value)) if (customerTerms && masheryTerms && (!shipmentTrackingSubscribe || ( shipmentTrackingSubscribe && document.getElementById("applications-shipment_tracking_sub_callback").value)) && (!oneRecordAPI || (oneRecordAPI && document.getElementById("applications-recordapi_recorduri_sub_callback").value))) { return true; } else { return false; } } // Update member form field when terms checked function setRequestedApisAndAcceptedTerms() { var acceptedTerms = ""; if (isFormComplete()) { var now = new Date(); var apis = document.getElementsByClassName("customerAPI"); var checkedApis = ""; for (let i = 0; i < apis.length; i++) { if (apis[i].checked == true) checkedApis = checkedApis + apis[i].nextSibling.data + ','; } document.getElementById("applications-requested_api_access").value = checkedApis; document.getElementById("applications-terms_and_conditions_accepted").value = now.toISOString(); document.getElementById("members-terms_accepted").value = now.toISOString(); document.getElementById("process-register").disabled = false; } else { document.getElementById("process-register").disabled = true; document.getElementById("members-terms_accepted").value = ""; } } // Update member form field when terms checked function setRequestedApisAndAcceptedTermsForEdit() { var acceptedTerms = ""; if (document.getElementById("customerTerms").checked) { var now = new Date(); var apis = document.getElementsByClassName("customerAPI"); var checkedApis = ""; for (let i = 0; i < apis.length; i++) { if (apis[i].checked == true) checkedApis = checkedApis + apis[i].nextSibling.data + ','; } document.getElementById("applications-requested_api_access").value = checkedApis; document.getElementById("applications-terms_and_conditions_accepted").value = now.toISOString(); document.getElementById("process-save").disabled = false; } else { document.getElementById("process-save").disabled = true; } } // Show shipment tracking callback url field function showShipmentTrackingSubscribeCallbackField() { var required = document.getElementById("shipmentTrackingSubscribe").checked; var fieldId = "applications-shipment_tracking_sub_callback"; if (required) { document.getElementById(fieldId).parentElement.classList.add("require"); document.getElementById(fieldId).classList.add("require"); document.getElementById(fieldId).hidden = false; if (!document.getElementById(fieldId).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); document.getElementById(fieldId).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // CS7608 Show oneRecordAPI callback url field function showoneRecordAPICallbackField() { var required = document.getElementById("oneRecordAPI").checked; var fieldId = "applications-recordapi_idpissuer_sub_callback"; var fieldId2 = "applications-recordapi_idppuburl_sub_callback"; var fieldID3 = "applications-recordapi_recorduri_sub_callback"; if (required) { //CS7608 Customer wants to make this field optional // document.getElementById(fieldId2).parentElement.classList.add("require"); // document.getElementById(fieldId2).classList.add("require"); document.getElementById(fieldId2).hidden = false; //CS7608 Customer wants to make this field optional // document.getElementById(fieldId).parentElement.classList.add("require"); // document.getElementById(fieldId).classList.add("require"); document.getElementById(fieldId).hidden = false; document.getElementById(fieldID3).parentElement.classList.add("require"); document.getElementById(fieldID3).classList.add("require"); document.getElementById(fieldID3).hidden = false; if (!document.getElementById(fieldID3).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } if (!document.getElementById(fieldId2).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } if (!document.getElementById(fieldId).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldID3).parentElement.classList.remove("require"); document.getElementById(fieldID3).classList.remove("require"); document.getElementById(fieldID3).hidden = true; document.getElementById(fieldId2).parentElement.classList.remove("require"); document.getElementById(fieldId2).classList.remove("require"); document.getElementById(fieldId2).hidden = true; document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); document.getElementById(fieldId).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { //CS7608 Customer wants to make this field optional // elem.classList.add("require"); // elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label Need to repeat as 2 sub-field labelss are controled by 1 checkbox els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId2.toLowerCase()) { if (required) { //CS7608 Customer wants to make this field optional // elem.classList.add("require"); // elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldID3.toLowerCase() ) { if (required) { // CS7608 Customer wants to make this field optional elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // CS7608 Show oneRecordAPIIdentityProvider callback url field // CS7608 Should be removed if showoneRecordAPICallbackField function is used function showoneRecordAPIIdentityProviderCallbackField() { var required = document.getElementById("oneRecordAPIIdentityProvider").checked; var fieldId = "applications-recordapi_idpissuer_sub_callback"; var fieldId2 = "applications-recordapi_idppuburl_sub_callback"; if (required) { document.getElementById(fieldId2).parentElement.classList.add("require"); document.getElementById(fieldId2).classList.add("require"); document.getElementById(fieldId2).hidden = false; document.getElementById(fieldId).parentElement.classList.add("require"); document.getElementById(fieldId).classList.add("require"); document.getElementById(fieldId).hidden = false; if (!document.getElementById(fieldId2).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } if (!document.getElementById(fieldId).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldId2).parentElement.classList.remove("require"); document.getElementById(fieldId2).classList.remove("require"); document.getElementById(fieldId2).hidden = true; document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); document.getElementById(fieldId).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label Need to repeat as 2 sub-field labelss are controled by 1 checkbox els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId2.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label descr CS7608 Kamlesh trying out var eld = document.getElementsByTagName("descr"); for (var i = 0; i < eld.length; i++) { var elem = eld[i]; if ((elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) || (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId2.toLowerCase())){ if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // CS7608 Show oneRecordAPIURI callback url field // CS7608 Should be removed if showoneRecordAPICallbackField function is used function showoneRecordAPIURICallbackField() { var required = document.getElementById("oneRecordAPIURI").checked; var fieldID3 = "applications-recordapi_recorduri_sub_callback"; if (required) { document.getElementById(fieldID3).parentElement.classList.add("require"); document.getElementById(fieldID3).classList.add("require"); document.getElementById(fieldID3).hidden = false; if (!document.getElementById(fieldID3).value) { if (document.getElementById("process-register")) { document.getElementById("process-register").disabled = true; } else { document.getElementById("process-save").disabled = true; } } } else { document.getElementById(fieldID3).parentElement.classList.remove("require"); document.getElementById(fieldID3).classList.remove("require"); document.getElementById(fieldID3).hidden = true; } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldID3.toLowerCase() ) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } // Same of the field's label descr CS7608 Kamlesh trying out var eld = document.getElementsByTagName("descr"); for (var i = 0; i < eld.length; i++) { var elem = eld[i]; if ((elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldID3.toLowerCase())) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); elem.hidden = false; } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); elem.hidden = true; } break; } } } // Check custom required fields and set submit disabled/enabled function updateSubmit() { // updated requested apis and accepted terms fields setRequestedApisAndAcceptedTerms(); if (isFormComplete()) { document.getElementById("process-register").disabled = false; } else { document.getElementById("process-register").disabled = true; } } // Check custom required fields and set submit disabled/enabled function updateSubmitForEdit() { // updated requested apis and accepted terms fields setRequestedApisAndAcceptedTermsForEdit(); if (document.getElementById("customerTerms").checked) { document.getElementById("process-save").disabled = false; } else { document.getElementById("process-save").disabled = true; } } // Display custom terms to user and add hidden field to store accepted terms window.addEventListener('portalAfterRender', function() { // Only run on member registration page if (!document.getElementById("page-member")) return; // Disable registration button until terms accepted const submit = document.getElementById("process-register"); submit.disabled = true; // Hide field storing accepted terms and its label document.getElementById("members-terms_accepted").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'members-terms_accepted') { elem.remove(); break; } } // Hide field storing oAuth callback url and its label document.getElementById("applications-oauth_redirect_uri").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-oauth_redirect_uri') { elem.remove(); break; } } // Hide field storing requested API access and its label document.getElementById("applications-requested_api_access").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-requested_api_access') { // remove descr elem.parentElement.getElementsByClassName("descr").forEach(elem => elem.remove()); elem.remove(); break; } } // Hide field storing requested API access and its label document.getElementById("applications-terms_and_conditions_accepted").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-terms_and_conditions_accepted') { elem.remove(); break; } } // Hide field storing shipment tracking subscribe callback document.getElementById("applications-shipment_tracking_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-shipment_tracking_sub_callback') { elem.hidden = true; break; } } //CS 7608 // Hide field storing recordapi identity provider issuer callback document.getElementById("applications-recordapi_idpissuer_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idpissuer_sub_callback') { // elem.parentElement.getElementsByClassName("descr").forEach(elem => elem.remove()); // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS 7608 // Hide field storing recordapi identity provider publickey url callback document.getElementById("applications-recordapi_idppuburl_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idppuburl_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS 7608 // Hide field storing recordapi one record uri callback document.getElementById("applications-recordapi_recorduri_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_recorduri_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } // Hide first para (it is duplicated) var paras = document.getElementsByTagName('p'); paras[0].hidden = true; paras[0].fontSize = "0%"; // Display customer terms //CS7608 added onclick actions for RoutingOffer // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIIdentityProvider" onclick="showoneRecordAPIIdentityProviderCallbackField()" onchange="updateSubmit()">ONE Record API - Use own Identity Provider</label> \ // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIURI" onclick="showoneRecordAPIURICallbackField()" onchange="updateSubmit()">ONE Record API - Use own ONE Record API</label> \ var apisRequested = '<p> \ <h3>Required API access</h3> \ <b>Select open API you would like to use:<br></b> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTracking" onchange="updateSubmit()">Shipment Tracking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTrackingSubscribe" onclick="showShipmentTrackingSubscribeCallbackField()" onchange="updateSubmit()">Shipment Tracking Subscribe API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="routingOffer" onchange="updateSubmit()">Routing Offer API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="stationInformation" onchange="updateSubmit()">Station Information API</label><br> \ <b>Select partner API (access will only be given upon prior approval and agreement by LH):</b><br> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="smartBooking" onchange="updateSubmit()">smartBooking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="airmail" onchange="updateSubmit()">Airmail API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoXML" onchange="updateSubmit()">CargoXML API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoIMP" onchange="updateSubmit()">CargoIMP API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="uldStatus" onchange="updateSubmit()">ULD Status API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPI" onclick="showoneRecordAPICallbackField()" onchange="updateSubmit()">ONE Record API</label> \ </p>'; var summHTML = document.getElementById("applications-summ").parentElement.innerHTML; document.getElementById("applications-summ").parentElement.innerHTML = summHTML + apisRequested; var customerTerms = '<label style="font-weight:normal"><input type="checkbox" id="customerTerms" onclick="setRequestedApisAndAcceptedTerms()">I agree to the <a href="/files/General_Terms_and_Conditions_API.pdf" target="_blank">General Terms and Conditions</a> and the applicable <a href="/files/Terms_of_Services.pdf" target="_blank">Terms of Services</a>.</label>'; // MUST have existing Mashery terms too - it's a TIBCO account var masheryTerms = '<label style="font-weight:normal"><input type="checkbox" id="masheryTerms" onclick="setRequestedApisAndAcceptedTerms()">I certify that I have read and agree to the <a href="http://www.mashery.com/terms/" target="_blank" >Mashery Terms of Service</a> and <a href="http://www.mashery.com/privacy/" target="_blank">Privacy Policy</a>.</label><br>'; document.getElementById("registration-terms-of-service").innerHTML = ""; // Push the terms above the submit button var submitHTML = document.getElementById("process-register").parentElement .innerHTML; document.getElementById("process-register").parentElement.innerHTML = customerTerms + masheryTerms + submitHTML; document.getElementById("registration-terms-of-service").innerHTML = ""; // Add call back URL field input document.getElementById("applications-shipment_tracking_sub_callback").setAttribute( "oninput", "updateSubmit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idpissuer_sub_callback").setAttribute( "oninput", "updateSubmit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idppuburl_sub_callback").setAttribute( "oninput", "updateSubmit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_recorduri_sub_callback").setAttribute( "oninput", "updateSubmit()"); // Add call back for text field input var requiredRegistrationTextFields = getRequiredRegistrationTextFields(); for (var field = 0; field < requiredRegistrationTextFields.length; field++) { var textField = document.getElementById(requiredRegistrationTextFields[field]); textField.setAttribute("oninput", "updateSubmit()"); } }); // Hide fields in apps edit page window.addEventListener('portalAfterRender', function() { // Only run on apps edit page if (document.getElementsByClassName("category-appedit").length == 0) return; // Disable registration button until terms accepted const submit = document.getElementById("process-save"); submit.disabled = true; // Hide field storing oAuth callback url and its label document.getElementById("applications-oauth_redirect_uri").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-oauth_redirect_uri') { elem.remove(); break; } } // Hide field storing requested API access and its label document.getElementById("applications-requested_api_access").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-requested_api_access') { // remove descr var descr = elem.parentElement.getElementsByClassName("descr"); for (var n = 0; n < descr.length; n++) { descr[n].remove(); } elem.remove(); break; } } // Hide field storing terms and conditions accepted and its label document.getElementById("applications-terms_and_conditions_accepted").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-terms_and_conditions_accepted') { elem.remove(); break; } } // Hide field storing shipment tracking subscribe callback document.getElementById("applications-shipment_tracking_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-shipment_tracking_sub_callback') { elem.hidden = true; break; } } //CS7608 // Hide field storing recordapi identityprovider tracking subscribe callback document.getElementById("applications-recordapi_idpissuer_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idpissuer_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS7608 // Hide field storing recordapi identityprovider tracking subscribe callback document.getElementById("applications-recordapi_idppuburl_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_idppuburl_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } //CS7608 // Hide field storing recordapi onerecorduri tracking subscribe callback document.getElementById("applications-recordapi_recorduri_sub_callback").hidden = true; var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for").toString().toLowerCase() == 'applications-recordapi_recorduri_sub_callback') { // remove descr CS7608 Kamlesh trying out -remove to hidden // var descr = elem.parentElement.getElementsByClassName("descr"); // for (var n = 0; n < descr.length; n++) { // // descr[n].remove(); // descr[n].hidden = true; // } elem.hidden = true; break; } } // Display customer terms // CS7608 Added oneRecordAPIIdentityProvider, oneRecordAPIURI // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIIdentityProvider" onclick="showoneRecordAPIIdentityProviderCallbackField()" onchange="updateSubmitForEdit()">ONE Record API - Use own Identity Provider</label> \ // <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPIURI" onclick="showoneRecordAPIURICallbackField()" onchange="updateSubmitForEdit()">ONE Record API - Use own ONE Record API</label> \ var apisRequested = '<p> \ <h3>Request further API access</h3> \ <p>Please select APIs you would like request access to. Further access will be granted after approval.</p> \ <b>Select open API:<br></b> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTracking" onchange="updateSubmitForEdit()">Shipment Tracking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="shipmentTrackingSubscribe" onclick="showShipmentTrackingSubscribeCallbackField()" onchange="updateSubmitForEdit()">Shipment Tracking Subscribe API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="routingOffer" onchange="updateSubmitForEdit()">Routing Offer API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="stationInformation" onchange="updateSubmitForEdit()">Station Information API</label><br> \ <b>Select partner API (access will only be given upon prior approval and agreement by LH):</b><br> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="smartBooking" onchange="updateSubmitForEdit()">smartBooking API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="airmail" onchange="updateSubmitForEdit()">Airmail API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoXML" onchange="updateSubmitForEdit()">CargoXML API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="cargoIMP" onchange="updateSubmitForEdit()">CargoIMP API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="uldStatus" onchange="updateSubmitForEdit()">ULD Status API</label> \ <label style=font-weight:normal><input type="checkbox" class="customerAPI" id="oneRecordAPI" onclick="showoneRecordAPICallbackField()" onchange="updateSubmit()">ONE Record API</label> \ </p>'; var summHTML = document.getElementById("applications-summ").parentElement.innerHTML; document.getElementById("applications-summ").parentElement.innerHTML = summHTML + apisRequested; var customerTerms = '<label style="font-weight:normal"><input type="checkbox" id="customerTerms" onclick="setRequestedApisAndAcceptedTermsForEdit()">I agree to the <a href="/files/General_Terms_and_Conditions_API.pdf" target="_blank">General Terms and Conditions</a> and the applicable <a href="/files/Terms_of_Services.pdf" target="_blank">Terms of Services</a>.</label>'; // Push the terms above the submit button var submitHTML = document.getElementById("process-save").parentElement .innerHTML; document.getElementById("process-save").parentElement.innerHTML = customerTerms + submitHTML; // Add call back URL field input document.getElementById("applications-shipment_tracking_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idpissuer_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_idppuburl_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); // CS7608 Add call back URL field input document.getElementById("applications-recordapi_recorduri_sub_callback").setAttribute( "oninput", "updateSubmitForEdit()"); }); // // Conditional contact request // function getContactFields() { // List of all custom fields added in the MashDash Model and Layout for contact request // Three arrays: one for each request dropdown select index var customContactFormFields = [ [], ["contact_request-message"], ["contact_request-api", "contact_request-httpStatus", "contact_request-affected_awb", "contact_request-company_name", "contact_request-complete_received_response", "contact_request-complete_request_body", "contact_request-conversation_id", "contact_request-issue_description", "contact_request-issue_timestamp", "contact_request-type_of_impairment", "contact_request-environment", "contact_request-url_accessed" ] ]; return customContactFormFields; } function getRequiredContactFields() { // List of required fields, ie must have a value. Can include custom and standard fields. // Three arrays: one for each request dropdown select index var requiredContactFields = [ [], ["contact_request-subject", "contact_request-message", "contact_request-name", "contact_request-email" ], ["contact_request-subject", "contact_request-name", "contact_request-email", "contact_request-company_name", "contact_request-type_of_impairment", "contact_request-environment", "contact_request-api", "contact_request-url_accessed", "contact_request-httpStatus", "contact_request-issue_description" ] ]; return requiredContactFields; } function changeContactFieldLabel(labelFor, labelText) { // Change label text var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == labelFor) { elem.innerHTML = labelText; break; } } } function setSubmitState() { // Skip post-submit pages if (!document.getElementById("contact_request-type")) return; // Enables the submit button if all required fields have values var formType = document.getElementById("contact_request-type").selectedIndex; if (formType == 0) { // No type selected document.getElementById("process-submit").disabled = true; } var requiredFields = getRequiredContactFields(); for (var field = 0; field < requiredFields[formType].length; field++) { if (!document.getElementById(requiredFields[formType][field]).value) { document.getElementById("process-submit").disabled = true; return; } } document.getElementById("process-submit").disabled = false; } function setContactFieldRequired(fieldId, required = false) { // Sets field to be required (ie must have a value) or not required) if (required) { document.getElementById(fieldId).parentElement.classList.add("require"); document.getElementById(fieldId).classList.add("require"); } else { document.getElementById(fieldId).parentElement.classList.remove("require"); document.getElementById(fieldId).classList.remove("require"); } // Same of the field's label var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (required) { elem.classList.add("require"); elem.parentElement.classList.add("require"); } else { elem.classList.remove("require"); elem.parentElement.classList.remove("require"); } break; } } } function setContactFieldDisplay(fieldId, showField) { // Show/hide form field // Input field: if (showField) { document.getElementById(fieldId).hidden = false; document.getElementById(fieldId).parentElement.style.visibility = "visible"; document.getElementById(fieldId).parentElement.style.fontSize = "100%"; } else { document.getElementById(fieldId).hidden = true; document.getElementById(fieldId).parentElement.style.visibility = "hidden"; document.getElementById(fieldId).parentElement.style.fontSize = "0%"; } // Fields label: var els = document.getElementsByTagName("label"); for (var i = 0; i < els.length; i++) { var elem = els[i]; if (elem.getAttribute("for") && elem.getAttribute("for").toString().toLowerCase() == fieldId.toLowerCase()) { if (showField) { elem.style.visibility = "visible"; elem.parentElement.style.visibility = "visible"; elem.parentElement.style.fontSize = "100%"; } else { elem.style.visibility = "hidden"; elem.parentElement.style.visibility = "hidden"; elem.parentElement.style.fontSize = "0%"; } break; } } } function setCustomLabels(formType) { // Custom label text per form type if (formType == 0) { // Default changeContactFieldLabel('contact_request-subject', 'Subject'); } else { // Not default changeContactFieldLabel('contact_request-subject', 'Issue Title'); } } function setContactFormType() { // Skip post-submit pages if (!document.getElementById("contact_request-type")) return; // Sets all the fields for different contact type selections var formType = document.getElementById("contact_request-type").selectedIndex; // Selected form index // If form type not selected so hide of defaults var defaultFields = ['contact_request-subject','contact_request-name','contact_request-handle','contact_request-email'] for (var defaultField = 0; defaultField < defaultFields.length; defaultField++) { if (formType == 0) { setContactFieldDisplay(defaultFields[defaultField], false); } else { setContactFieldDisplay(defaultFields[defaultField], true); } } var contactFields = getContactFields(); var displayedFieldsProcessed = []; var requiredFieldsProcessed = []; // Loop over all possible form selections for (var form = 0; form < contactFields.length; form++) { var formState = false; if (form == formType) { formState = true; } // Display all fields for this form type for (var contactField = 0; contactField < contactFields[form].length; contactField++) { if (displayedFieldsProcessed.includes(contactFields[form][contactField])) break; setContactFieldDisplay( contactFields[form][contactField], formState); if (form == formType) displayedFieldsProcessed.push(contactFields[form] [contactField]); } // Set required fields var requiredFields = getRequiredContactFields(); for (var requiredField = 0; requiredField < requiredFields[form].length; requiredField++) { if (requiredFieldsProcessed.includes(requiredFields[form][requiredField])) break; setContactFieldRequired( requiredFields[form][requiredField], formState); if (form == formType) requiredFieldsProcessed.push(requiredFields[ form][requiredField]); } } // Set custom labels setCustomLabels(formType); // Clear form when it changes type var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type.toLowerCase() == 'text') { inputs[i].value = ''; } } var textareas = document.getElementsByTagName('textarea'); for (var i = 0; i < textareas.length; i++) { textareas[i].value = ''; } if (formType == 0) { document.getElementById('contact_request-type_of_impairment').selectedIndex = -1; document.getElementById('contact_request-environment').selectedIndex = -1; document.getElementById('contact_request-api').selectedIndex = -1; } document.getElementById("process-submit").disabled = true; } // Conditional contact request window.addEventListener('portalAfterRender', function() { // Only run on contact request page if (!document.getElementById("page-contact")) return; // Skip post-submit pages if (!document.getElementById("contact_request-type")) return; // Set up the form setContactFormType(); setSubmitState(); // Add field onchange listener to be able to enable/disable submit var requiredFields = getRequiredContactFields(); document.getElementById("process-submit").disabled = true; for (var formType = 0; formType < requiredFields.length; formType++) { for (var field = 0; field < requiredFields[formType].length; field++) { document.getElementById(requiredFields[formType][field]).setAttribute( "oninput", "setSubmitState()"); } } // Add request type select onchange document.getElementById("contact_request-type").setAttribute( "onchange", "setContactFormType()"); }); //]]> </script> <script src="/files/main.js" type="text/javascript"></script> <script type="text/javascript" > m$.init(portalOptions); </script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10