SearchStax API - Basic Auth - SearchStax Toggle navigation Documentation Help Center Support Search Signup Login Free Trial Free Trial Policy Getting Started Quick Start Integrate Solr with... Drupal 7 Drupal 8 Haystack Sitecore 9.0 Sitecore 9.1 Sitecore Commerce 9.1 Sitecore 9.2 Sitecore Commerce 9.2 Sitecore 9.3 Sitecore Commerce 9.3 Sitecore 10.0 Sitecore Special Indexes Cloud Manager Deployments Securing Deployments Log Files Adding Custom JARs Backups Disaster Recovery Private Cloud Amazon Azure Google Pulse/Monitoring Solr Performance Email Alerts Webhooks Search Analytics Analytics Overview Search Event API Analytics Apps Dashboard Usage Metrics Relevance Metrics Response Metrics SearchStax API Authentication API Users API Basic Auth API IP Filtering API Deployment API DNS Alias API Backup/Restore API Tags API Alerts API Webhooks API ZooKeeper API Third-Party Integration PagerDuty New Relic Accounts and Billing Account Setup Managing Users Support Guide User Guide SearchStax API - Basic Auth Overview SearchStax® provides an API supporting the creation, deletion and management of SearchStax deployments. This page describes how to manage Solr Basic Auth features through the API. The API can be accessed through any tool that assembles HTTP requests and dispatch them to a server. Among these would be the Python coreapi package, the Postman tool, and cURL. For Windows, use PowerShell Core 6.1+. Account Owner, Admin, or Technical Contact To run the SearchStax Provisioning API, you must be the account Owner, an account Admin, or a Technical Contact. See SearchStax User Roles. Symbols enclosed in carets (< and >) such as are metavariables. Substitute your local values when you encounter them in the examples. Contents: Solr Basic Auth account > deployment > solr > auth > enable_basic_auth account > deployment > solr > auth > disable_basic_auth account > deployment > solr > auth > add_solr_user account > deployment > solr > auth > delete_solr_user account > deployment > solr > auth > get_solr_users account > deployment > solr > auth > set_solr_user_password account > deployment > solr > auth > set_solr_user_role Related Pages: Authentication API Users API IP Filtering API Deployment API DNS Alias API Backup/Restore API Tags API Alerts API Webhooks API Zookeeper API Solr Basic Auth The SearchStax Provisioning API provides a selection of methods for managing Solr basic authentication from a remote application. account > deployment > solr > auth > enable_basic_auth This method enables basic auth for a Solr deployment. GET https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/enable/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. There is no request body. When invoked from Linux (Bash script): curl --request GET "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/enable/" \ --header "Authorization: APIkey " When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $RESULT = Invoke-RestMethod -Method Get -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/enable/" $RESULT = $RESULT | ConvertTo-Json This method returns a JSON document containing a success message. { "message": "Basic authentication successfully Enabled for Solr", "success": "true" } account > deployment > solr > auth > disable_basic_auth This method disables basic auth for a Solr deployment. GET https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/disable/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. There is no request body. When invoked from Linux (Bash script): curl --request GET "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/disable/" \ --header "Authorization: APIkey " \ When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $RESULT = Invoke-RestMethod -Method Get -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/disable/" $RESULT = $RESULT | ConvertTo-Json This method returns a JSON document containing a success message. { "message": "Basic authentication successfully Disabled for Solr", "success": "true" } account > deployment > solr > auth > add_solr_user This method adds a Solr user to the deployment. Basic auth must be enabled. POST https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/add-user/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. The request body should be a "application/json" encoded object, containing the following items: { "username" : "demoSolrUser", "password" : "test123", "role" : "Admin" } Parameter Description Example username required string This is the Solr user name. "demoSolrUser" password required string This is the Solr user's password. "test123" role required string This is the Solr role: Admin, Read, Write, or ReadWrite. "Admin" See Solr Basic Authentication for an explanation of the Solr roles. When invoked from Linux (Bash script): curl --request POST "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/add-user/" \ --header "Authorization: Token " \ --header "Content-Type: application/json" \ --data "{ \"username\" : \"demoSolrUser\", \"password\" : \"test123\", \"role\" : \"Admin\" }" When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $body = @{ username='demoSolrUser' password='test123' role='Admin' } $body = $body | ConvertTo-Json $RESULT = Invoke-RestMethod -Method Post -body $body -ContentType 'application/json' -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/add-user/" $RESULT = $RESULT | ConvertTo-Json This method returns a JSON document containing a success message. { "message": "User successfully added", "success": "true" } account > deployment > solr > auth > delete_solr_user This method deletes a Solr user from a deployment. POST https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/delete-user/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. The request body should be a "application/json" encoded object, containing the following items: { "username" : "demoSolrUser" } Parameter Description Example username required string This is the Solr user name. "demoSolrUser" When invoked from Linux (Bash script): curl --request POST "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/delete-user/" \ --header "Authorization: APIkey " \ --header "Content-Type: application/json" \ --data "{ \"username\" : \"demoSolrUser\" }" When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $body = @{ username='demoSolrUser' } $body = $body | ConvertTo-Json $RESULT = Invoke-RestMethod -Method Post -body $body -ContentType 'application/json' -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/delete-user/" $RESULT = $RESULT | ConvertTo-Json This method returns a JSON document containing a success message. { "message": "User successfully deleted!", "success": "true" } account > deployment > solr > auth > get_solr_users This method gets the Solr users for a deployment. GET https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/get-users/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. There is no request body. When invoked from Linux (Bash script): curl --request GET "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/get-users/" \ --header "Authorization: APIkey " When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $RESULT = Invoke-RestMethod -Method Get -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/get-users/" $RESULT = $RESULT | ConvertTo-Json The response is a JSON document containing the Solr users and the roles associated with them. { "users": { "demoSolrUser": { "roles": "Read Write Admin" } }, "success": "true" } account > deployment > solr > auth > set_solr_user_password This method sets a password for a Solr user. POST https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/set-password/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. The request body should be a "application/json" encoded object, containing the following items: { "username" : "demoSolrUser", "password": "test456" } Parameter Description Example username required string This is the Solr user name. "demoSolrUser" password required string This is the Solr user's password. "test456" When invoked from Linux (Bash script): curl --request POST "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/set-password/" \ --header "Authorization: APIkey " \ --header "Content-Type: application/json" \ --data "{ \"username\" : \"demoSolrUser\", \"password\": \"test456\" }" When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $body = @{ username='demoSolrUser' password='test456' } $body = $body | ConvertTo-Json $RESULT = Invoke-RestMethod -Method Post -body $body -ContentType 'application/json' -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/set-password/" $RESULT = $RESULT | ConvertTo-Json This method returns a JSON document containing a success message. { "message": "Password successfully updated!", "success": "true" } account > deployment > solr > auth > set_solr_user_role This method sets the Solr user's role. Available roles are Admin, Read, Write, and ReadWrite. POST https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/set-role/ where is the name of the tenant account, and is the ID of the deployment. This method uses either Token authentication or API Key authentication. The request body should be a "application/json" encoded object, containing the following items: { "username" : "demoSolrUser", "role" : "Read" } Parameter Description Example username required string This is the Solr user name. "demoSolrUser" role required string This is the Solr role: Admin, Read, Write, or ReadWrite. "Read" See Solr Basic Authentication for an explanation of the Solr roles. When invoked from Linux (Bash script): curl --request POST "https://app.searchstax.com/api/rest/v2/account//deployment//solr/auth/set-role/" \ --header "Authorization: APIkey " \ --header "Content-Type: application/json" \ --data "{ \"username\" : \"demoSolrUser\", \"role\" : \"Read\" }" When invoked from Windows (PowerShell script): $ACCOUNT = "AccountName" $uid = "ss123456" $body = @{ username='demoSolrUser' role='Read' } $body = $body | ConvertTo-Json $RESULT = Invoke-RestMethod -Method Post -body $body -ContentType 'application/json' -Headers $headers ` -uri "https://app.searchstax.com/api/rest/v2/account/$ACCOUNT/deployment/$uid/solr/auth/set-role/" $RESULT = $RESULT | ConvertTo-Json This method returns a JSON document containing a success message. { "message": "Successfully updated user role!", "success": "true" } Questions? Do not hesitate to contact the SearchStax Support Desk. Copyright © SearchStax, Inc. ×Close Search From here you can search these documents. Enter your search terms below.