CINXE.COM
Sprinklr - Welcome to the Sprinklr Developer Network!
<!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 = '0895519c5b908916b5c4'; //<![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>Sprinklr - Welcome to the Sprinklr Developer Network!</title> <link rel="stylesheet" type="text/css" media="screen" href="/files/sprinklr-skin.css" /> <style type="text/css" media="screen"> <!-- .no-margin { margin: 0; } .no-margin-top { margin-top: 0; } .no-margin-bottom { margin-bottom: 0; } .margin-top { margin-top: 1.5625em; } .margin-bottom { margin-bottom: 1.5625em; } .margin-bottom-small { margin-bottom: 0.5em; } .margin-bottom-large { margin-bottom: 2em; } .margin-left { margin-left: 1.5625em; } .margin-left-small { margin-left: 0.5em; } .margin-right { margin-right: .5625em; } .margin-right-small { margin-right: 0.5em;; } .no-padding { padding: 0; } .no-padding-top { padding-top: 0; } .no-padding-bottom { padding-bottom: 0; } .padding-top { padding-top: 1.5625em; } .padding-bottom { padding-bottom: 1.5625em; } .padding-bottom-small { padding-bottom: 0.5em; } .padding-bottom-large { padding-bottom: 2em; } .padding-left { padding-left: 1.5625em; } .padding-left-small { padding-left: 0.5em; } .padding-right { padding-right: .5625em; } .padding-right-small { padding-right: 0.5em;; } --> </style> <style type="text/css" media="screen"> <!-- #main-wrapper .btn-copy:not(.btn-link){white-space:nowrap;margin-top:5px;padding:.5em .8em;font-size:14px} .hero-text-wrapper{padding-top:7%} .get-support{background:rgba(255,255,255,.5)} #nav-docs h2{display:none;visibility:hidden} #nav-docs ul li{list-style:none} #nav-docs ul>li:first-child{display:none} #nav-docs ul li ul>li:first-child{display:block} #nav-docs ul li a{text-decoration:none;font-weight:500;display:inline-block;margin-bottom:4px} #nav-docs ul li ul li a{font-weight:400} #nav-docs a{color:#000;text-decoration:none} #nav-docs .current-page>.link-block-styled,#nav-docs .current-page>a,#nav-docs>ul>li>a{color:#0069ff} #nav-docs ul li ul{margin-left:1em} #nav-docs li.postman_collection_for_sprinklr_apis{display:none;visibility:hidden} .badge-post{background-color:#2ea2fb} .badge-get{background-color:#3c9} .badge-put{background-color:#ecad00} .badge-delete{background-color:#d149a6} .badge{color:#fff;display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;margin-right:.5em} .endpoint-url{background-color:#f7f7f7;border:1px solid #e5e5e5;margin-bottom:1.5625em;padding:.9375em;color:#6594ac;font-size:20px;border-radius:.5em} td,th{border:1px solid #d7d7e0;padding:15px 20px;letter-spacing:.17px} a.btn.btn-info{margin-top:.25rem;margin-bottom:.25rem;color:#fff;background-color:#8c43ff;border-color:#8c43ff;font-weight:400;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;float:right} a.btn.btn-info:focus,a.btn.btn-info:hover{color:#fff!important;background-color:#8c43ff;border-color:#8c43ff} input.MyButton{position:relative;padding:20px;cursor:pointer;font-weight:700;font-size:150%;background:#5bc0de;color:#fff;border:1px solid #8c43ff;border-radius:10px} .sample-request-header,.sample-response-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:0 1.5rem;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:.3rem;border-top-right-radius:.3rem;background-color:rgba(255,255,255,.2)} .sample-request-title,.sample-response-title{color:#fff;font-size:1rem;font-weight:400;text-transform:capitalize} .sample-request,.sample-response{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-width:100%;pointer-events:auto;background-color:#030706;color:#fff;background-clip:padding-box;border:1px solid #e6e9f9;outline:0;margin-bottom:2rem;border-radius:15px;overflow:hidden} .language-json,.sample-request-body,.sample-response-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;max-height:500px;overflow-y:auto;background-color:#030706;color:#fff;border-radius:15px} .sample-request-body pre,.sample-response-body pre{color:#fff;background-color:transparent;padding:0 1.5rem} .bd-callout{background:#f2f2f4;border-radius:15px;padding:1.5rem 1.4rem;margin-top:1.25rem;margin-bottom:1.25rem} .bd-callout strong{display:block;font-size:38px;line-height:48px;font-weight:500;margin-bottom:20px} .bd-callout code{background-color:transparent} .bd-callout p{margin:0} .token.punctuation{display:inline} .token.property{display:inline} .token.operator{display:inline} .token.string{display:inline} .token.number{display:inline} .token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{display:inline} .token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{display:inline} .api-card{background:#fff;border-radius:9px;box-shadow:0 2px 10px 0 rgba(0,0,0,.2);padding:40px 35px 10px;height:100%} .api-card em,.api-card svg{font-size:1.5em;display:block;margin-bottom:.36em;height:1em;width:1.4em;line-height:1} .api-cards-list{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin-right:-12.5px;margin-left:-12.5px} .api-cards-list>li{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%;padding:12.5px;margin:0} .form-wrapper{background-image:url(/files/contact-blue.png);background-position:center;background-size:cover;border-radius:15px;padding:30px 30px 15px;position:relative} .form-wrapper .form-info{width:100%;padding-right:15px;padding-left:15px} .form-wrapper .form-container{width:100%;float:right;padding-right:15px;padding-left:15px} .after-form-submit{position:absolute;left:0;top:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;display:none} .after-form-submit .close{position:absolute;cursor:pointer;top:15px;right:25px;font-size:1.5em} .after-form-submit h3{line-height:41px;font-size:36px;margin-bottom:26px} @media (min-width:768px){ .form-wrapper{padding:60px 60px 40px;border-radius:30px} .api-card em{font-size:2em} } @media (min-width:1024px){ .form-wrapper .form-container{max-width:430px;width:40%} .form-wrapper .form-info{max-width:620px;width:60%} .form-wrapper{padding:5%} } .form-wrapper h2{color:#fff;padding-top:0;margin-top:0} .form-wrapper a{color:#fff} .form-wrapper p{font-size:1.1em} .form-group{margin-bottom:20px} .form-control{border:1px solid #6d7278;border-radius:8px;background-color:#fff;font-size:16px;font-weight:400;padding:8px 24px;line-height:2;margin-bottom:0} .custom-checkbox::after{content:"";display:block;clear:both} .custom-checkbox label{font-weight:400;max-width:calc(100% - 1.75em);margin-right:0;float:left} .custom-checkbox input[type=checkbox]{float:left;height:1em;width:1em;margin-right:.75em;margin-top:.3em} .button{outline:0;border-radius:8px;font-size:.75em;text-transform:uppercase;border-style:solid;border-width:1px;padding:.6em 1.5em;line-height:2em;display:block;width:100%} .button-blue{background-color:#1c6cfd;border-color:#1c6cfd;color:#fff} .copyright-section{padding:37px 15px 25px;background-color:#3c4543} .social-links{font-size:2em} .social-links a{position:relative} .social-links a::before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:1.75em;width:1.75em;border-radius:50%;transition:all .3s ease;background-color:transparent} .social-links a:hover::before{background-color:rgb(255 255 255 / .15)} #mashery-made{display:none} .loading [type=submit]{position:relative;pointer-events:none} .loading [type=submit]::before{content:"";position:absolute;left:0;top:0;bottom:0;right:0;background-color:rgb(0 0 0 / .4)} .loading [type=submit]::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:1.6em;width:1.6em;border:3px solid #fff;border-radius:50%;border-top-color:transparent;animation-name:btnSpin;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear} @keyframes btnSpin{ 0%{transform:translate(-50%,-50%) rotate(0)} 60%{transform:translate(-50%,-50%) rotate(270deg)} 100%{transform:translate(-50%,-50%) rotate(360deg)} } .rating{display:inline-flex;flex-direction:row-reverse;list-style-type:none;margin:0;padding:0} .rating li{position:relative;cursor:pointer} .rating li.active::after,.rating li.active~li::after,.rating li:hover::after,.rating li:hover~li::after{content:"\2605";position:absolute;left:0;top:0} .rating li.active::before{content:"\2606";position:absolute;animation-name:growStar;animation-duration:.5s} @keyframes growStar{ 0%{opacity:1;transform:scale(1)} 100%{opacity:0;transform:scale(2.5)} } .notifications{position:fixed;top:0;right:0;bottom:0;max-width:300px;pointer-events:none;padding-top:25px} .notification{pointer-events:all;background-color:#1c6cfd;color:#fff;overflow:hidden;border-radius:4px;margin-right:2px;transition:all .3s ease;margin-bottom:15px} .notification-head{padding:6px 15px;background-color:rgb(0 0 0 / .2);line-height:1.15} .notification-body{padding:10px 15px;font-size:16px} .notification.success{background-color:#2fb78a} .notification.danger{background-color:#d1497b} @media (max-width:991px){ .api-cards-list>li{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%} } @media (max-width:575px){ .api-cards-list>li{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%} } .descr { font-size: 0.8125em; font-weight: normal; } --> </style> <script src="/public/Mashery/scripts/themes/blackbeard/placeholders.js" type="text/javascript"></script> <script src="https://kit.fontawesome.com/39e025f811.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ //]]> </script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-146355792-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-146355792-1'); //]]> </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-page" class="page-page read en_US"> <!-- PAGE --> <div id="page" class="page read no_sub"> <!-- HEADER --> <div id="header" class="header"> <div id="branding" class="branding"> <div id="branding-logo" class="branding-logo"> Sprinklr </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.sprinklr.com/login/login?r=https%3A%2F%2Fdeveloper.sprinklr.com%2F&h=ca8a4896b8a106c30729bc0ac38fbee8">Sign In</a> </li> <li class="register"> <a href="https://developer.sprinklr.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"> <h1 class="first">Welcome to the Sprinklr Developer Network!</h1> <div class="section"> <div class="section-body"> <header class="bg-hero padding-bottom-xlarge"> <div class="container"> <div class="row"> <div class="grid-half hero-text-wrapper"> <h1 class="banner-title">Welcome to the Sprinklr Developer Portal</h1> <p>A robust list of RESTful web service APIs to integrate data with any external system. Developers can create applications to interact directly with data found within the Sprinklr platform.</p> </div> <div class="grid-half text-right"> <img class="image-responsive shadow-none" alt="sprinklr" src="/files/dev-sprinklr.png"> </div> </div> </div> </header> <section class="api-section"> <div class="container"> <div class="section-header text-center"> <h2 class="no-margin-top">Get Started Using Sprinklr APIs</h2> <p>Follow these steps to register for access keys, setup and test, subscribe to Webhooks, and review the documentation and tutorials.</p> </div> <ul class="list-unstyled api-cards-list"> <li> <div class="api-card"> <a href="/member/register" class="link-block"> <h5 class="no-padding-top"><em aria-hidden="true" class="fas fa-user-plus"></em> Register</h5> </a> <p class="text-medium">Developers must have a Sprinklr Enterprise License and known environment.</p> </div> </li> <li> <div class="api-card"> <a href="/docs/read/authorize/OAuth_for_Customers" class="link-block"> <h5 class="no-padding-top"><em aria-hidden="true" class="fas fa-key"></em> Access Token</h5> </a> <p class="text-medium">After creating an app and getting the API Key, you need to follow these step-by-step instructions of the authentication process to generate an access token and make your first API call.</p> </div> </li> <li> <div class="api-card"> <a href="/docs/read/API_Overview" class="link-block"> <h5 class="no-padding-top"><em aria-hidden="true" class="far fa-file-alt"></em> Read the Docs</h5> </a> <p class="text-medium">Sprinklr offers a variety of robust, convenient and simple RESTful Web service APIs to integrate data from Sprinklr to any external system. Review the documentation or use the Interactive API.</p> </div> </li> <li> <div class="api-card"> <a href="/docs/read/API_Tutorials" class="link-block"> <h5 class="no-padding-top"><em aria-hidden="true" class="far fa-file-code"></em> API Tutorials</h5> </a> <p class="text-medium">These tutorials will cover the basics of connecting to the Sprinklr APIs as well as some common use cases for extracting data.</p> </div> </li> <li> <div class="api-card"> <a href="https://developer.sprinklr.com/BETA_APIS" class="link-block"> <h5 class="no-padding-top"><em style="font-size:50px;">β</em>BETA APIS</h5> </a> <p class="text-medium">Sprinklr’s beta APIs are a great way to test the latest Sprinklr features. These APIs are still being tweaked by our teams to meet Sprinklr’s high quality standards of general availability (GA) releases. </p> </div> </li> <li> <div class="api-card"> <a href="/docs/read/changelog/q4_2023" class="link-block"> <h5 class="no-padding-top"><em aria-hidden="true" class="fas fa-exclamation-triangle"></em> Changelog</h5> </a> <p class="text-medium">API changelog provides every minute change details of APIs to ensure that API developer-consumers are aware of any upgrades or changes in the endpoints. </p> </div> </li> <li> <div class="api-card"> <a href="mailto:tickets@sprinklr.com" class="link-block"> <h5 class="no-padding-top"><em aria-hidden="true" class="fas fa-question"></em> Get Support</h5> </a> <p class="text-medium">Ask questions and get advice by sending an email to our support team.<br><br><br><br><br></p> </div> </li> <li> <div class="api-card"> <a href="https://community.sprinklr.com/login" class="link-block"> <h5 class="no-padding-top"> <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 84 59" height="59px" width="84px"> <title>Community</title> <g fill-rule="evenodd" fill="none" stroke-width="1" stroke="none" id="Page-1"> <g stroke-width="1.75" stroke="#000000" fill-rule="nonzero" fill="#000000" transform="translate(-556.000000, -1892.000000)" id="01-Developer-Landing-Page"> <g transform="translate(103.000000, 1433.000000)" id="Group-28-Copy"> <g transform="translate(419.500000, 425.000000)" id="Group-24-Copy-3"> <g transform="translate(35.500000, 35.000000)" id="Community"> <g transform="translate(0.000000, 8.000000)" id="Group"> <path id="Shape" d="M15.9432,18.9332609 C10.7874,18.9332609 6.59295,14.7632609 6.59295,9.63847826 C6.59295,4.51369565 10.7874,0.343043478 15.9432,0.343043478 C21.099,0.343043478 25.2928,4.51304348 25.2928,9.63847826 C25.2928,14.763913 21.099,18.9332609 15.9432,18.9332609 Z M15.9432,2.95173913 C12.22065,2.95173913 9.19295,5.95173913 9.19295,9.63847826 C9.19295,13.3252174 12.22065,16.3245652 15.9432,16.3245652 C19.6651,16.3245652 22.6928,13.3252174 22.6928,9.63847826 C22.6928,5.95173913 19.6651,2.95173913 15.9432,2.95173913 Z"></path> <path id="Path" d="M19.70475,44.6686957 L3.3982,44.6686957 C1.52425,44.6686957 0,43.1491304 0,41.2813043 L0,37.0147826 C0,28.2802174 7.15195,21.1741304 15.9432,21.1741304 C19.4012,21.1741304 22.69215,22.2567391 25.45855,24.3045652 C26.0364,24.7323913 26.15925,25.548913 25.73285,26.1286957 C25.30645,26.7078261 24.4933,26.8317391 23.9148,26.403913 C21.59885,24.6893478 18.8422,23.7828261 15.9432,23.7828261 C8.58585,23.7828261 2.6,29.718913 2.6,37.0147826 L2.6,41.2813043 C2.6,41.7104348 2.95815,42.06 3.3982,42.06 L19.7054,42.06 C20.423,42.06 21.0054,42.6443478 21.0054,43.3643478 C21.0054,44.0843478 20.423,44.6686957 19.70475,44.6686957 Z"></path> </g> <g transform="translate(54.000000, 8.000000)" id="Group"> <path id="Path" d="M22.6846829,43.9864118 L6.77585366,43.9864118 C6.0757561,43.9864118 5.50756098,43.4066471 5.50756098,42.6922941 C5.50756098,41.9779412 6.0757561,41.3981765 6.77585366,41.3981765 L22.6853171,41.3981765 C23.1146341,41.3981765 23.4640488,41.0513529 23.4640488,40.6255882 L23.4640488,36.3925294 C23.4640488,29.1532353 17.6241951,23.2643529 10.4462927,23.2643529 C7.44804878,23.2643529 4.52146341,24.3177647 2.20492683,26.2311176 C1.66082927,26.6801765 0.862439024,26.5954118 0.421073171,26.0395882 C-0.0190243902,25.4844118 0.0640487805,24.6691176 0.609414634,24.2194118 C3.37556098,21.9346471 6.86907317,20.6761176 10.4462927,20.6761176 C19.0224878,20.6761176 26,27.7264706 26,36.3925294 L26,40.6255882 C26,42.4781176 24.5129268,43.9864118 22.6846829,43.9864118 Z"></path> <path id="Shape" d="M10.4456585,18.7925294 C5.41560976,18.7925294 1.32409756,14.6552353 1.32409756,9.57064706 C1.32409756,4.48605882 5.41560976,0.348117647 10.4456585,0.348117647 C15.4757073,0.348117647 19.5678537,4.48541176 19.5678537,9.57064706 C19.5678537,14.6558824 15.4750732,18.7925294 10.4456585,18.7925294 Z M10.4456585,2.93635294 C6.81453659,2.93635294 3.86068293,5.91282353 3.86068293,9.57064706 C3.86068293,13.2284706 6.81453659,16.2042941 10.4456585,16.2042941 C14.0774146,16.2042941 17.0312683,13.2284706 17.0312683,9.57064706 C17.0312683,5.91282353 14.0767805,2.93635294 10.4456585,2.93635294 Z"></path> </g> <g transform="translate(18.000000, 0.000000)" id="Group"> <path id="Shape" d="M39.5644118,57 L4.43558824,57 C2.10229412,57 0.203823529,55.1138182 0.203823529,52.7949545 L0.203823529,46.8352159 C0.203823529,34.9241591 9.98088235,25.2341591 22,25.2341591 C34.0191176,25.2341591 43.7961765,34.9241591 43.7961765,46.8352159 L43.7961765,52.7949545 C43.7961765,55.1138182 41.8977059,57 39.5644118,57 Z M22,27.8257159 C11.4089412,27.8257159 2.79205882,36.3536932 2.79205882,46.8358636 L2.79205882,52.7956023 C2.79205882,53.6855795 3.52970588,54.4097386 4.43558824,54.4097386 L39.5637647,54.4097386 C40.4696471,54.4097386 41.2072941,53.6855795 41.2072941,52.7956023 L41.2072941,46.8358636 C41.2079412,36.3536932 32.5910588,27.8257159 22,27.8257159 Z"></path> <path id="Shape" d="M21.5502941,23.7204205 C14.9554706,23.7204205 9.58941176,18.3999886 9.58941176,11.8598864 C9.58941176,5.31978409 14.9548235,0 21.5502941,0 C28.1457647,0 33.5111765,5.32043182 33.5111765,11.8605341 C33.5111765,18.4006364 28.1451176,23.7204205 21.5502941,23.7204205 Z M21.5502941,2.59090909 C16.3822353,2.59090909 12.1776471,6.74931818 12.1776471,11.8605341 C12.1776471,16.97175 16.3822353,21.1301591 21.5502941,21.1301591 C26.7183529,21.1301591 30.9229412,16.97175 30.9229412,11.8605341 C30.9229412,6.74931818 26.7183529,2.59090909 21.5502941,2.59090909 Z"></path> </g> </g> </g> </g> </g> </g> </svg> Sprinklr Community </h5> </a> <p class="text-medium">A safe and collaborative environment where customers are encouraged to ask questions, share ideas, and advice with each other.</p> </div> </li> </ul> </div> </section> </div> </div> <!-- END SECTION --> </div><!-- /main --> <!-- SUB --> <div id="sub" class="sub"> </div> <!-- /SUB --> <div id="breadcrumbs"> </div><!-- /breadcrumbs --> <div id="local" class="local"> <ul> <li class=" first"><a href="https://developer.sprinklr.com/docs/read/API_Overview">Documentation</a></li> <li class=" last"><a href="https://developer.sprinklr.com/docs/read/api_overview/Getting_Started">Getting Started</a></li> </ul> </div><!-- /local --> <div id="nav" class="nav"> </div><!-- /nav --> </div> <!-- /CONTENT --> <div id="footer" class="footer"> <!-- 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 = "http://developer.sprinklr.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"> </div> <div id="extra2"> </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[ https://developer.sprinklr.com/blog/read/Checking_Sprinklr_Env. /*! * Templates & Initializations * sprinklr v1.0.0 * Portal Theme Starter Kit v2.7.17 - Default Theme * http://github.com/mashery/portal-theme-starter-kit */ /** * Theme Templates */ // Remove the user nav window.portalOptions.templates.userNav = null; // Adjust the primary nav window.portalOptions.templates.primaryNav = `<div class="nav-primary nav-wrap" id="nav-primary"> <div class="container padding-top-small padding-bottom-small"> <!-- <a id="logo" class="logo" href="/">{{content.logo}}</a> --> <a id="logo" class="logo" href="/"> <img src="/files/sprinklr-dev-portal-logonew.png" alt="sprinklr"> </a> <a role="button" class="nav-toggle" id="nav-primary-toggle" data-nav-toggle=".nav-collapse" href="#">{{content.menuToggle}}</a> <div class="nav-menu"> <div id="nav-user-menu" class="nav-collapse"> <ul class="nav" id="nav-user-list"> {{content.navItemsUser}} </ul> </div> <div id="nav-primary-menu" class="nav-collapse"> <ul class="nav" id="nav-primary-list"> {{content.navItemsPrimary}} <li style="height: 29px; width:29px; padding: 0"> <a href="/search" style="display: block; width:29px; height: 29px;"> <img src="/files/ic_search.svg" /> </a> </li> </ul> </div> </div> </div> </div>`; // 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>'; }; // Footer 2 // The second of two footer content sections. window.portalOptions.templates.footer2 = ` <div class="footer-2" id="footer-2"> <div class="container"> <div class="text-center"> <h2 class="text-white">Connect with us on Social</h2> <ul class="list-inline social-links"> <li><a href="https://www.facebook.com/sprinklr"><i class="fa fa-facebook"></i></a></li> <li><a href="https://twitter.com/Sprinklr"><i class="fa fa-twitter"></i></a></li> <li><a href="https://www.linkedin.com/company/sprinklr/"><i class="fa fa-linkedin"></i></a></li> <li><a href="https://www.youtube.com/c/sprinklr"><i class="fa fa-youtube-play"></i></a></li> </ul> </div> </div> </div> <div class="copyright-section"> <div class="container"> <div class="row"> <div class="grid-two-thirds text-left-large"> <ul class="list-inline no-margin-bottom" style="margin-top: 3px"> <li><a href="https://www.sprinklr.com/"><svg xmlns="http://www.w3.org/2000/svg" style="height:40px;width:48px;margin-bottom:-0.6em;" viewBox="0 0 137.31 111.2" aria-describedBy="logo-footer-title"><title id="logo-footer-title">Sprinklr</title><path fill="currentColor" d="M9.79 19.17A12.15 12.15 0 0 1 22.67 7.71a12.94 12.94 0 0 1 7.91 2.93C46.51 24.5 55.9 49 53.06 70.14c-.14 1-1.34 1-1.64 0C47 55 32.24 37.54 19.15 32.34c-6.2-2.46-9.76-7-9.36-13.18M122.84 17.95c0-9.64-8.09-18.21-19.89-17.94-22.4.51-52.5 58.14-35.27 110.48.21 1.06 1.24.86 1.31-.22 2.4-36.42 24.28-64.93 43.94-76 7.74-4.36 9.91-9.71 9.91-16.32M0 70.69C.51 78 6.6 81.54 12.21 81.54c12.79 0 28.78 6 38.19 13.83.78.65.92.43.41-1.34C47 80.71 26.64 58.4 11.83 58.4A11.6 11.6 0 0 0 0 70.69M137.28 70.69c-.49 7.28-6.57 10.85-12.18 10.85-12.79 0-28.78 6-38.19 13.83-.78.65-.92.43-.41-1.34 3.81-13.32 24.17-35.63 39-35.63a11.6 11.6 0 0 1 11.81 12.29"/></svg></a></li> <li><span class="text-small">© ${new Date().getFullYear()} Sprinklr Inc.</span></li> </ul> </div> <div class="grid-third text-right-large"><a target="_blank" href="https://sprinklr.com/contact-us" class="btn btn-primary">Contact</a></div> </div> </div> </div> `; // '<div class="footer-2 container" id="footer-2">' + // '<div class="row">' + // '<div class="grid-two-thirds text-left-large">' + // '<ul class="list-inline">' + // '<li><a href="https://www.sprinklr.com/"><svg xmlns="http://www.w3.org/2000/svg" style="height:2em;width:1.6em;margin-bottom:-0.6em;" viewBox="0 0 137.31 111.2" aria-describedBy="logo-footer-title"><title id="logo-footer-title">Sprinklr</title><path fill="currentColor" d="M9.79 19.17A12.15 12.15 0 0 1 22.67 7.71a12.94 12.94 0 0 1 7.91 2.93C46.51 24.5 55.9 49 53.06 70.14c-.14 1-1.34 1-1.64 0C47 55 32.24 37.54 19.15 32.34c-6.2-2.46-9.76-7-9.36-13.18M122.84 17.95c0-9.64-8.09-18.21-19.89-17.94-22.4.51-52.5 58.14-35.27 110.48.21 1.06 1.24.86 1.31-.22 2.4-36.42 24.28-64.93 43.94-76 7.74-4.36 9.91-9.71 9.91-16.32M0 70.69C.51 78 6.6 81.54 12.21 81.54c12.79 0 28.78 6 38.19 13.83.78.65.92.43.41-1.34C47 80.71 26.64 58.4 11.83 58.4A11.6 11.6 0 0 0 0 70.69M137.28 70.69c-.49 7.28-6.57 10.85-12.18 10.85-12.79 0-28.78 6-38.19 13.83-.78.65-.92.43-.41-1.34 3.81-13.32 24.17-35.63 39-35.63a11.6 11.6 0 0 1 11.81 12.29"/></svg></a></li>' + // '<li><span class="text-small">© ' + new Date().getFullYear() + ' Sprinklr Inc.</span></li>' + // '</ul>' + // '</div>' + // '<div class="grid-third text-right-large"><p>{{content.masheryMade}}</p></div>' + // '</div>' + // '</div>'; // Custom Footer 2 // The second of two footer content sections. // window.portalOptions.templates.footer2 = // '<div class="footer-2 container" id="footer-2">' + // '<div class="grid">' + // '<div class="footer_menu_company">' + // '<img src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/logo_burst_white.svg"> <span class="footer__copyright">©2019 SPRINKLR INC.</span>' + // '</div>' + // '<ul class="footer_menu_aux" id="menu-footer-menu-aux">' + // '<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://www.sprinklr.com/privacy/">Privacy</a></li>' + // '<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://www.sprinklr.com/terms/">Terms</a></li>' + // '<li class="menu-item menu-item-type-custom menu-item-object-custom"><a>Cookies</a></li>' + // '</ul>' + // '<ul class="footer_menu" id="menu-footer-menu">' + // '<li class="menu-item menu-item-type-custom menu-item-object-custom"><a href="http://sprinklr.com/contact-us">CONTACT</a></li>' + // '<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://www.sprinklr.com/careers/">CAREERS</a></li>' + // '<li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://www.sprinklr.com/impressum/">IMPRESSUM</a></li>' + // '<li class="menu-item menu-item-type-custom menu-item-object-custom"><a href="https://www.sprinklr.com/preference-center">PREFERENCE CENTER</a></li>' + // '</ul>' + // '<ul class="footer_menu_social">' + // '<li><a href="https://www.facebook.com/sprinklr"><img class="footer_menu_social_logo" src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/facebook_logo.svg"></a></li>' + // '<li><a href="https://twitter.com/sprinklr"><img class="footer_menu_social_logo" src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/twitter_logo.svg"></a></li>' + // '<li><a href="https://www.linkedin.com/company/sprinklr"><img class="footer_menu_social_logo" src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/linkedin_logo.svg"></a></li>' + // '<li><a href="https://www.youtube.com/c/sprinklr"><img class="footer_menu_social_logo" src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/youtube_logo.svg"></a></li>' + // '<li><span class="separator"></span></li>' + // '<li><a href="https://itunes.apple.com/us/app/sprinklr/id413619434?mt=8"><img class="footer_menu_social_logo" src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/apple_logo.svg"></a></li>' + // '<li><a href="https://play.google.com/store/apps/details?id=com.sprinklr.android&hl=en"><img class="footer_menu_social_logo" src="https://www.sprinklr.com/wp-content/themes/sprinklr/assets/images/icons/android_logo.svg"></a></li>' + // '</ul>' + // '</div>' + // '</div>'; // Add theme style hook document.documentElement.className += ' js-theme-skinny-nav'; /** * Load custom typeface */ window.addEventListener('portalAfterInit', function () { m$.loadJS('https://cdn.jsdelivr.net/gh/bramstein/fontfaceobserver@2.1.0/fontfaceobserver.standalone.js', function () { m$.loadCSS('https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,700,700i'); var font = new FontFaceObserver('Open Sans'); font.load().then(function () { document.documentElement.classList.add('fonts-loaded'); }); }); // Load jQuery m$.loadJS('https://code.jquery.com/jquery-3.2.1.min.js', function () { // $("#nav-docs li button.btn-link").each(function( index ) { // var link = $(this).prev('a'); // var button = $(this).detach(); // $(link).prepend(button); // }); $(".api-method").contents().detach().prependTo(".grid-three-fourths h1"); $(".try-it-btn").detach().appendTo(".grid-three-fourths h1").show(); $("#nav-docs ul li a").each(function( index ) { if($(this).next().next('ul').length) { $(this).addClass('expandable'); } var value = $(this).text().toLowerCase().replace(/ /g,"_").replace(/\./g, '_'); $(this).parent().addClass(value); }); }); }, false); window.addEventListener('portalBeforeRender', function () { if (mashery.globals.noHeading) { document.documentElement.classList.add('page-no-heading'); } else { document.documentElement.classList.remove('page-no-heading'); } }, false); /** * Favicon * Add a favicon/tab icon for your Portal. */ window.portalOptions.favicon = true; /** * Logo * Add a custom logo. Accepts any markup as a string (`<img src>`, `<svg></svg>`, etc.). */ portalOptions.logo = '<svg version="1.1"xmlns="http://www.w3.org/2000/svg" style="height:35px;width:86px;" viewBox="0 0 199.9 92.3" xml:space="preserve" aria-labelledby="logo-title"><title>Sprinklr Developer Portal</title><path fill="#ffffff" d="M.3 74.6l.4-.5c.3-.4.9-.6 1.4-.2.1 0 .1.1.2.2 2.6 2.2 5.9 3.3 9.3 3.3 4 0 7.5-2.1 7.5-6.1 0-8.3-18-6-18-16.6 0-5.8 4.9-8.8 10.5-8.8 3.2-.1 6.3.9 8.9 2.8.5.3.6.9.4 1.4l-.1.1-.4.5c-.3.5-.9.6-1.4.3-.1 0-.1-.1-.2-.2-2.1-1.6-4.7-2.4-7.4-2.3-3.7 0-7.4 1.7-7.4 5.9 0 8.5 18 6 18 16.8 0 5.2-4.5 8.8-10.5 8.8-4.1.1-8-1.3-11-4-.5-.3-.6-.9-.2-1.4-.1 0-.1 0 0 0M30.4 47.7c-.1-.5.3-1 .9-1.1h.7c.5-.1 1 .3 1.1.9v3c0 .9-.1 1.8-.2 2.6h.1s2.7-7.3 11.8-7.3c8.8 0 14.1 7 14.1 17.1 0 10.4-6.1 17.1-14.5 17.1-4.9 0-9.4-2.9-11.4-7.4h-.1c.2.9.3 1.9.3 2.9v15.7c.1.5-.3 1-.9 1.1h-.7c-.5.1-1-.3-1.1-.9v-.2l-.1-43.5zm14 29.7c6.4 0 11.6-5.3 11.6-14.5 0-8.8-4.7-14.4-11.4-14.4-6 0-11.6 4.2-11.6 14.5 0 7.2 4.1 14.4 11.4 14.4M67.7 47.7c-.1-.5.3-1 .9-1.1h.7c.5-.1 1 .3 1.1.9v5.3c0 .9-.1 1.8-.2 2.7h.1c1.6-5 5.5-9.1 11-9.1.6-.1 1.2.2 1.3.8V48.1c0 .7-.6 1.2-1.3 1.1h-.2c-7.3 0-10.8 8.7-10.8 16v13c.1.5-.3 1-.9 1.1h-.7c-.5.1-1-.3-1.1-.9v-.2l.1-30.5zM88.5 47.7c-.1-.5.3-1.1.8-1.1h1c.5-.1 1.1.3 1.1.8v30.8c.1.5-.3 1.1-.8 1.1h-1c-.5.1-1.1-.3-1.1-.8V47.7zM101.7 47.7c-.1-.5.3-1 .9-1.1h.7c.5-.1 1 .3 1.1.9v4.8c0 .9-.1 1.8-.3 2.7h.1c2.3-5.6 7.8-9.2 13.8-9.2 8.5 0 10.8 5 10.8 12.8v19.6c.1.5-.3 1-.9 1.1h-.7c-.5.1-1-.3-1.1-.9V59.5c0-5.7-.7-11.1-8-11.1s-13.7 6.1-13.7 14.5v15.2c.1.5-.3 1-.9 1.1h-.7c-.5.1-1-.3-1.1-.9V47.7zM139.5 34.6c-.1-.5.3-1 .9-1.1h.7c.5-.1 1 .3 1.1.9v25h5.8l10.1-12.2c.3-.4.8-.7 1.4-.6h1c.9 0 1.2.6.6 1.4l-10.7 12.7v.1l12 17.1c.5.8.2 1.4-.7 1.4h-1c-.5 0-1.1-.2-1.3-.7L148.1 62h-5.8v16.2c.1.5-.3 1-.9 1.1h-.7c-.5.1-1-.3-1.1-.9v-.2l-.1-43.6zM170 34.6c-.1-.5.3-1 .9-1.1h.7c.5-.1 1 .3 1.1.9V71.7c0 4.6 2.2 5 3.8 5.2.6 0 1 .4 1 1v.4c.1.5-.2 1.1-.8 1.2h-.4c-1.9 0-6.4-.7-6.4-6.9l.1-38zM184.9 47.7c-.1-.5.3-1 .9-1.1h.7c.5-.1 1 .3 1.1.9v5.3c0 .9-.1 1.8-.3 2.7h.1c1.6-5 5.5-9.1 11-9.1.6-.1 1.2.2 1.3.8V48.1c0 .7-.6 1.2-1.3 1.1h-.2c-7.3 0-10.8 8.7-10.8 16v13c.1.5-.3 1-.9 1.1h-.5c-.5.1-1-.3-1.1-.9V47.7zM69.6 6.6c.1-2.3 2.1-4.1 4.4-4h.1c1 0 2 .4 2.7 1 5.7 5.2 8.6 12.9 7.8 20.5 0 .4-.5.4-.6 0-1.5-5.2-6.6-11.3-11.1-13.1-2.2-.7-3.4-2.3-3.3-4.4M108.6 6.2c-.1-3.5-3-6.3-6.6-6.2h-.3C94 .2 83.6 20.1 89.6 38.2c.1.4.4.3.5-.1.8-12.6 8.4-22.4 15.2-26.2 2.1-1.1 3.5-3.3 3.3-5.7M66.2 24.4c.1 2.2 2 3.9 4.2 3.8 4.8.2 9.4 1.8 13.2 4.8.3.2.3.1.1-.5-1.3-4.6-8.3-12.3-13.5-12.3-2.2 0-4 1.7-4.1 3.9.1.1.1.2.1.3M113.6 24.4c-.1 2.2-2 3.9-4.2 3.8-4.8.2-9.4 1.8-13.2 4.8-.3.2-.3.1-.1-.5 1.3-4.6 8.3-12.3 13.5-12.3 2.2 0 4 1.7 4.1 3.9 0 .1 0 .2-.1.3"/></svg>'; /** * Initialize plugins */ window.addEventListener('portalAfterRender', function () { // Expand-and-collapse nav on small viewports astro.init(); // Enhanced documentation var docs = {}; if (document.querySelector('.better-docs-nav')) { docs = new BetterDocs('.content', { langs: { bash: { selector: 'bash', title: 'Bash' }, js: { selector: 'javascript, js', title: 'JavaScript', }, ruby: { selector: 'ruby', title: 'Ruby' }, python: { selector: 'python', title: 'Python' } }, langDefault: 'js', wideLayout: (document.documentElement.classList.contains('js-theme-sidebar') ? true : false), }); } // Destroy instantiation on Ajax page reload window.addEventListener('portalBeforeRender', function () { if ('destroy' in docs) { docs.destroy(); } }, false); // Conditional content // Add logged-in/logged-out class if (window.mashery.loggedIn) { document.documentElement.classList.add('is-logged-in'); document.documentElement.classList.remove('is-logged-out'); } else { document.documentElement.classList.add('is-logged-out'); document.documentElement.classList.remove('is-logged-in'); } // 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(); // Smooth scrolling to anchor links var scroll = {}; scroll = new SmoothScroll('.category-page #main-wrapper a[href*="#"], .category-docs #main-wrapper a[href*="#"], .category-docs #main-wrapper a[href*="#"], .category-blogall #main-wrapper a[href*="#"], .category-blogsingle #main-wrapper a[href*="#"], #nav-docs a[href*="#"]', { ignore: '.js-scroll-ignore' }); // Destroy instantiation on Ajax page reload window.addEventListener('portalBeforeRender', function () { if ('destroy' in scroll) { scroll.destroy(); } }, false); // Language translation // NOTE: You should update this with your desired options, languages, and translations. // Details at https://developer.mashery.com/docs/customizing_your_portal/plugins/Translate // var translate = new Translate(); // Sticky footer stickyFooter('#footer'); if (mashery.contentType === 'ioDocs') { window.setTimeout(function () { stickyFooter('#footer'); }, 300); } // Expand/collapse docs navigation docsNavCollapse.init(); }, false); // Registration page link window.addEventListener('portalAfterRender', function () { if (mashery.contentId !== 'apps-register') return; let legends = document.querySelectorAll('legend'); for (let legend of legends) { if (!legend.textContent.includes('Select the Sprinklr Environment')) continue; legend.innerHTML += ' <a target="_blank" href="https://developer.sprinklr.com/blog/read/Checking_Sprinklr_Env">Click here</a> for steps for extracting your Sprinklr environment.<br><span class="descr padding-top-small"><strong>Note:</strong> Select API Bundle checkbox for the relevant Sprinklr environment</span>'; } }); window.addEventListener('portalAfterRenderAjax', function() { $(".api-method").contents().detach().prependTo(".grid-three-fourths h1"); $(".try-it-btn").detach().appendTo(".grid-three-fourths h1").show(); $("#nav-docs ul li a").each(function( index ) { if($(this).next().next('ul').length) { $(this).addClass('expandable'); } var value = $(this).text().toLowerCase().replace(/ /g,"_").replace(/\./g, '_'); $(this).parent().addClass(value); }); }); window.addEventListener('load', function() { var element = document.querySelectorAll('#nav-docs ul'); Array.from(element).forEach(function(ele, i) { ele.setAttribute("id", 'item' + (i + 1)); }); }); window.addEventListener('portalAfterRender', function () { $(".api-method").contents().detach().prependTo(".grid-three-fourths h1"); $(".try-it-btn").detach().appendTo(".grid-three-fourths h1").show(); }, false); // update 2020 function createNotification(data) { var notification = document.createElement('div') notification.classList.add('notification') notification.innerHTML = `<div class="notification-head">${data.heading}</div><div class="notification-body">${data.message}</div>` return notification } function getNotification(options) { var notificationType = '' var heading = (options.heading) ? options.heading.trim() : ''; var message = (options.message) ? options.message.trim() : ''; var time = parseInt(options.time); time = (options.time && time) ? time : 4000; if(document.getElementsByClassName('notifications').length){ let notificationElement = createNotification({ heading: heading, message: message }); if (options.type) { let type = options.type.toLocaleLowerCase().trim() notificationType = (['primary', 'success', 'danger', 'info', 'warning', 'dark'].includes(type)) ? type : ''; notificationElement.classList.add(notificationType) } setTimeout(() => { notificationElement.remove() }, time) document.getElementsByClassName('notifications')[0].appendChild(notificationElement) } else{ let notificationWrapper = document.createElement('div') notificationWrapper.classList.add('notifications') document.body.appendChild(notificationWrapper) getNotification(options) } } function copyToClip(str) { if(typeof(str) == 'string'){ function listener(e) { e.clipboardData.setData("text/html", str); e.clipboardData.setData("text/plain", str); e.preventDefault(); } document.addEventListener("copy", listener); document.execCommand("copy"); document.removeEventListener("copy", listener); return true } return false }; function thankyou(isShowing = true){ if(isShowing){ document.querySelector('.form-wrapper .form-details').style.visibility = "hidden" document.querySelector('.form-wrapper .after-form-submit').style.display = "flex" } else{ document.querySelector('.form-wrapper .form-details').style.visibility = "visible" document.querySelector('.form-wrapper .after-form-submit').style.display = "none" } } function copyCode(clickedElement){ if(copyToClip(clickedElement.parentNode.parentNode.children[1].children[0].innerText)){ getNotification({ heading: 'Success', message: "Code copy to clipboard.", type: "success" }) } else{ getNotification({ heading: 'Error!!', message: "Type error!!", type: "error" }) } } function submitForm(form) { form.classList.add('loading') const data = new FormData(form) fetch("https://sprinklr.tfaforms.net/responses/processor", { method: "POST", body: data, // "no-cors" mode + redirect: "follow" allows us to handle the redirect ourselves // and FormAssembly ALWAYS wants to redirect :( // solution inspired from: https://stackoverflow.com/questions/37668282/unable-to-fetch-post-without-no-cors-in-header mode: "no-cors", redirect: "follow", }).then( res => { debugger form.classList.remove('loading') // the forms have a redirect // this identifies that we got a response if (res.type === "opaque") { //setIsSubmitSuccess("success") // Change this to trigger the success message form.reset() thankyou() // Change this to trigger the success message console.log({res}) return res } }, // Note: it's important to handle errors here // instead of a catch() block so that we don't swallow // exceptions from actual bugs in components. error => { form.classList.remove('loading') console.log({error}) getNotification({ heading: 'Error!!', message: "Oops! Something went wrong.", type: "error" }) // Change this to trigger the error message } ) return false } // rating function raterInit(selector = "#rater", starCount = 5){ var wrapper = document.querySelector(selector); var ul = document.createElement('ul') ul.classList.add('rating') while(starCount > 0){ let li = document.createElement('li') li.setAttribute('data-rating', starCount) li.setAttribute('data-title', `${starCount} star`) li.appendChild(document.createTextNode('☆')) ul.appendChild(li) starCount-- } wrapper.appendChild(ul) } window.addEventListener('load', (event) => { raterInit("#rater") var ratingStars = document.querySelectorAll('.rating li') ratingStars.forEach(listItem => { listItem.addEventListener('click', function(e){ let element = e.target let parent = e.currentTarget.parentElement ratingStars.forEach(star => { star.classList.remove('active') }); element.classList.add('active') parent.classList.add('rated') submitRating(element) }); }); }); function submitRating(selectedStar) { let rate = parseInt(selectedStar.dataset.rating); let pageLocation = window.location.href let user = (typeof mashery != 'undefined') ? mashery.username : 'Anonymous'; fetch('https://us-central1-sprinklr-9adfa.cloudfunctions.net/insertRating', { method: 'post', headers: { 'Content-Type': 'application/json' // 'Content-Type': 'application/x-www-form-urlencoded', }, body: JSON.stringify({ rate: rate, pageLocation: pageLocation, user: user }), }).then(function (response) { return response.json(); }).then(function (data) { console.log(data) }).catch(function (err) { console.log(err) }); }; //]]> </script> <script src="/files/main.min.js" type="text/javascript"></script> <script type="text/javascript" > m$.init(portalOptions); </script> </body> </html>