Analytics API
View SearchUnify data on a platform of your choice.
Prerequisites
Ensure that you have fulfilled the prerequisites before making your first call.
1. Set a user scope
SearchUnify users can have one of these five scopes. Each scope has an impact on the calls a user can make. The instructions to change user scope are in Change User Scope (API and SDK).
2. Create an app
At the time of creating an app, you obtain a client ID and client secret. Both are used to ascertain your identity. The process of creating an app has been explained in Get Client ID and Client Secret with an API App.
3. Obtain access and refresh tokens using the app
Access and a refresh tokens are required to be able to use the Analytics API. The process of generating these tokens has been explained in Get Access and Refresh Token Using curl.
Using Access and Refresh Tokens
The token generation call produces two kinds of tokens: Refresh and Access.
The refresh token expires every 14 days. Store it securely. The sole use of refresh tokens is to generate access tokens.
Access tokens expire every four hours. They authenticate users. It is mandatory to include them in the header of your API calls. The format is -H "authorization: Bearer {{access token}}
"
.
Base URL
https://{{hostname}}/api/v2/
The hostname is the URL of your SearchUnify instance.
Example Base URL
https://mycompany.searchunify.com/api/v2/
Endpoints
Overview
Tiles
Returns data on visitors, search users, clicks, results, cases, and other essential search behavior. The data is fetched as long as from
and to
are less than 180 days apart.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
from
|
Required | Only the activity on or after from are considered. |
string |
to
|
Required | Only the activity on or before to are considered. |
string |
uid
|
Optional | It is your search client ID. If a uid is not specified, then the cumulative data for all your search clients is considered. |
string |
Example Request
curl -X POST 'https://mycompany.searchunify.com/api/v2/searchOverview/getTileData'
-H 'Content-Type: application/json'
-H "authorization: Bearer 42977368f75cce9b59e1791d9700fc4f2ed1eb4d"
--data-binary $'{\n "from":"2019-12-01", \n"to":"2019-12-31", \n"uid":"3a70b1f3-06c3-11ea-9de0-ea4d55341fa1"\n}'
Example Response
{
"status": true,
"message": "tile data",
"data": {
"visitors": "48",
"searchUsers": "31",
"searches": "43",
"withResult": "38",
"withoutResult": "5",
"uniqueSearches": "38",
"clicks": "9",
"caseCount": "11",
"uniqueFailedSearches": "22",
"noClickSearches": "29",
"searchesWithoutResults": "5",
"usersWithFailedSearches": "23"
}
}
Search Summary
Returns how All Searches, All Searches with Results, and All Searches with Clicks (conversions) have changed over the period between from
and to
.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
from
|
Required | Only the activity on or after from are considered. |
string |
to
|
Required | Only the activity on or before to are considered. |
string |
uid
|
Optional | It is your search client ID. If a uid is not specified, then the cumulative data for all your search clients is considered. |
string |
Example Request
curl -X POST 'https://mycompany.searchunify.com/api/v2/searchOverview/getSearchSummaryChart'
-H 'Content-Type: application/json'
-H "authorization: Bearer 42977368f75cce9b59e1791d9700fc4f2ed1eb4d"
--data-binary $'{\n "from":"2019-11-01", \n"to":"2019-12-31", \n"uid":"3a70b1f3-06c3-11ea-9de0-ea4d55341fa1"\n}'
Example Response
{
"status": true,
"message": "search summary chart",
"data": {
"All searches ": [
{
"count": 0,
"ts": "2020-04-27",
"key": 1587945600000
},
{
"count": "1",
"ts": "2020-05-04",
"key": 1588550400000
}
],
"All searches with results": [
{
"count": 0,
"ts": "2020-04-27",
"key": 1587945600000
},
{
"count": "15",
"ts": "2020-05-04",
"key": 1588550400000
}
],
"Conversions": [
{
"count": 0,
"ts": "2020-04-27",
"key": 1587945600000
},
{
"count": "1",
"ts": "2020-05-04",
"key": 1588550400000
}
],
"format": "week",
"conversionPercentage": 300
}
}
Understanding the Response
This API reflects data in the following admin panel analytics report:
We can see the top level keys in the response JSON:
- All Searches: Total searches in date range (it is a single date from which we can calculate from and to) provided in each item in the array.
- All Searches with Results: The elements in the array are same as above just the counts are now for searches which produced results
- Conversions: Number of searches which got results clicked. The format is the same as the above two.
Format: This property defines what range is considered for each key in the data. It can have 3 different values: day
, week
, month
- When the format is
day
it means thatcount
is for the mentioned in thets
field - When the format is
week
then it means thatcount
is for previous 7 days including the date ints
field - When the format is
month
then it means thatcount
is for previous month including the date ints
field
Conversion Percentage: Its overall conversion percentage for date range provided in parameters to the API
Search Reports
Returns the most popular search queries.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the searches made on or after startDate are considered. |
string |
endDate
|
Required | Only the searches made on or before endDate are considered. |
string |
count
|
Required | Limits the response to count search queries. If count == 5 , then five most popular search queries are returned. |
integer |
searchClientId
|
Optional | If a searchClientId is not specified, then the cumulative data for all your search clients is considered. |
string |
Example Request
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchQuery/all? \
startDate=2019-11-01&endDate=2019-12-09&count=20&searchClientId=3a70b1f3-2345-11ea-1234-ea4d55341fa1' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer ab2a6fb00cfc4c064dc46eb12a0b6b03af7cdcb4"
Example Response
"{
"status": true,
"message": "search query all",
"data": [
{
"value": "c# complie",
"count": "4"
},
{
"value": "javascript",
"count": "4"
}
]
}"
Returns the most popular search queries for which results were found.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the searches made on or after startDate are considered. |
string |
endDate
|
Required | Only the searches made on or before endDate are considered. |
string |
count
|
Required | Limits the response to count search queries. If count == 5 , then five most popular search queries (for which at least one result was found) are returned. |
integer |
searchClientId
|
Optional | If a searchClientId is not specified, then the cumulative data for all your search clients is considered. |
string |
Example Request
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchQuery/withResults? \
startDate=2019-11-01&endDate=2019-12-09&count=5&searchClientId=3a70b1f3-2345-11ea-1234-ea4d55341fa1' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer ab2a6fb00cfc4c064dc46eb12a0b6b03af7cdcb4"
Example Response
"{
"status": true,
"message": "search with results",
"data": [
{
"value": "case creation",
"count": "1"
},
{
"value": "c# complie",
"count": "4"
}
]
}
Returns the most popular search queries for which results were found but users didn't click on any of them.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the searches made on or after startDate are considered. |
string |
endDate
|
Required | Only the searches made on or before endDate are considered. |
string |
count
|
Required | Limits the response to count search queries. If count == 5 , then 5 queries are returned. |
integer |
searchClientId
|
Optional | If a searchClientId is not specified, then the cumulative data for all your search clients is considered. |
string |
Example Response
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchQuery/withNoClicks? \
startDate=2019-11-01&endDate=2019-12-09&count=5&searchClientId=3a70b1f3-2345-11ea-1234-ea4d55341fa1' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer ab2a6fb00cfc4c064dc46eb12a0b6b03af7cdcb4"
Example Response
"{
"status": true,
"message": "search with no clicks",
"data": [
{
"count": "1",
"value": "case creation"
},
{
"count": "4",
"value": "c# complie"
}
]
}
Returns the most popular search queries for which no results were found.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the searches made on or after startDate are considered. |
string |
endDate
|
Required | Only the searches made on or before endDate are considered. |
string |
count
|
Required | Limits the response to count search queries. If count == 5 , then five most popular search queries (for which no results were found) are returned. |
integer |
searchClientId
|
Optional | If a searchClientId is not specified, then the cumulative data for all your search clients is considered. |
string |
Example Request
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchQuery/withoutResults? \
startDate=2019-11-01&endDate=2019-12-09&count=5&searchClientId=3a70b1f3-2345-11ea-1234-ea4d55341fa1' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer ab2a6fb00cfc4c064dc46eb12a0b6b03af7cdcb4"
Example Response
{
"status": true,
"message": "search without results",
"data": [
{
"count": "2",
"value": "checkkkkkkkk"
},
{
"count": "1",
"value": "nioo"
}
]
}
Search and Conversion Data
Returns search and conversion data over the period between startDate
and endDate
.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the searches made on or after startDate are considered. |
string |
endDate
|
Required | Only the searches made on or before endDate are considered. |
string |
searchClientId
|
Optional | It is your search client ID. If a searchClientId is not specified, then the cumulative data for all your search clients is considered. |
string |
count
|
Required | Limits the response to count search queries. If count == 5 , then five most popular search queries are returned. |
int |
Example Request
curl -X POST 'https://mycompany.searchunify.com/api/v2/searchQuery/histogram' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer b97bcf11c4be792b20d1f463bd48adc0ceec73ac" \
--data-binary $'{\n "startDate":"2019-11-01", \n"endDate":"2019-12-31",
\n"searchClientId":"3a70b1f3-06c3-11ea-9de0-ea4d55341fa1",
\n"count":2\n}'
Example Response
{
"status": true,
"message": "search without results",
"data": [
{
"count": "2",
"value": "checkkkkkkkk"
},
{
"count": "1",
"value": "nioo"
}
]
}
Understanding the Response
- When the format is
day
it means thatcount
is for the mentioned in thets
field - When the format is
week
then it means thatcount
is for previous 7 days including the date ints
field - When the format is
month
then it means thatcount
is for previous month including the date ints
field
The response contains numbers for both All Searches and Conversions.
Returns the total number of queries that didn't produce even one result. The data is for the period between startDate
and endDate
.
Parameters
Parameter | Optional / Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the searches made on or after startDate are considered. |
string |
endDate
|
Required | Only the searches made on or before endDate are considered. |
string |
searchClientId
|
Optional | It is your search client ID. If a searchClientId is not specified, then the cumulative data for all your search clients is considered. |
string |
count
|
Required | Limits the response to count search queries. If count == 5 , then five most popular search queries are returned. |
string |
Example Request
curl -X POST 'https://mycompany.searchunify.com/api/v2/searchQuery/missedQueryHistogram' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer b97bcf11c4be792b20d1f463bd48adc0ceec73ac" \
--data-binary $'{\n "startDate":"2019-11-01", \n"endDate":"2019-12-31",
\n"uid":"3a70b1f3-06c3-11ea-9de0-ea4d55341fa1"
\n"count":2 \n}'
Example Response
{
"status": true,
"message": "search without results",
"data": [
{
"count": "2",
"value": "checkkkkkkkk"
},
{
"count": "1",
"value": "nioo"
}
]
}
Understanding the Response
- When the format is
day
it means thatcount
is for the mentioned in thets
field - When the format is
week
then it means thatcount
is for previous 7 days including the date ints
field - When the format is
month
then it means thatcount
is for previous month including the date ints
field
The response contains numbers for both All Searches and Conversions.
Return the activity on a case.
Parameter |
Optional Required | Description | Data Type |
---|---|---|---|
startDate
|
Required | Only the cases created or updated on or after startDate are considered. |
|
endDate | Required | Only the cases created or updated on or before endDate are considered. | |
count | Required | Number of cases to be returned. | |
caseUID | Required | The Salesforce case ID. |
Request
{
"endDate": "2020-05-31",
"startDate": "2020-05-01",
"count": 100,
"caseUid": "242fcf57-XYZ-ABDEC-021eec4c243a"
}
Response
"{
"status": true,
"message": "Case Journey",
"data": [
{
"StartDate": "2020-04-26T15:02:27.000Z",
"ActivityType": "Search",
"ActivityValue": "testing"
},
{
"StartDate": "2020-04-26T15:08:33.000Z",
"ActivityType": "Search",
"ActivityValue": "new testing"
},
{
"StartDate": "2020-04-26T15:10:32.000Z",
"ActivityType": "Search",
"ActivityValue": "data"
}
]
}"
Conversions
Prints a list of the count
most popular documents. For count=5
, you will get 5 results. The data is from between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
Decimal literals | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
View most popular documents between May 1, 2019 and May 5, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchConversion/all? \
startDate=2019-05-01&endDate=2019-05-05&count=3&searchClientId=fa1c40fe-5664-11e9-9905-f23c91e2022e' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
{
"status": true,
"message": "Most Popular Docs",
"data": [
{
"doc": "https://ap16.salesforce.com/5002v00002iKiVqAAK",
"count": "1"
},
{
"doc": "https://ap16.salesforce.com/5002v00002iKmeNAAS",
"count": "1"
}
]
}
Prints a list of the count
documents that are not on the first page. These documents can be boosted to enhance search experience.. For count=5
, you will get 5 results. The data is from between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
Decimal literals | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
View the most popular documents that were not on the first page between May 1, 2019 and May 5, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchConversion/notOnFirstPage? \
startDate=2019-05-01&endDate=2019-05-05&count=3&searchClientId=fa1c40fe-5664-11e9-9905-f23c91e2022e' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
"{
"status": true,
"message": "Not On First Page",
"data": [
{
"doc": "https://ap16.salesforce.com/5002v00002iKiVqAAK",
"count": "1"
},
{
"doc": "https://stackoverflow.com/questions/59563095/how-to-pass-variable-into-match-function-javascript",
"count": "1"
}
]
}"
Prints a chart of the popularity (indexData) of all your content sources (indexName). The data is presented in an alphabetical order and includes: objectName, objectData, filterName, filterData, facetName, and facetName. An objectName is a content type and a filter is a high-level facet. The data is from between startDate
and endDate
.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
Example Request
View the popularity of content sources, content types, filters, and facets between May 1, 2019 and May 5, 2019.
curl -X GET ''https://mycompany.searchunify.com/v2/searchConversion/withFilters?
startDate=2019-05-01&endDate=2019-05-05' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
Example Response
{
"indexName": "JIRA",
"indexData": 6,
"ObjectsTypes": [
{
"objectName": "Jira",
"objectData": 6,
"Filters": [
{
"filterName": "JIRA",
"filterData": 3,
"Facets": [
{
"facetName": "CENG",
"facetData": 2
},
{
"facetName": "Workforce Dimensions",
"facetData": 1
}
]
}
]
}
]
}
Prints a list of the count
most popular searches in a session. For count=5
, you will get 5 results. The data is from between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
Decimal literals | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
View most popular searches in a session between May 1, 2019 and May 5, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
and search session ID 1557756499744112
.
curl -X GET 'https://mycompany.searchunify.com/api/v2/ \
searchConversion/bySessionsId/1557756499744112? \
startDate=2019-05-01&endDate=2019-05-05&count=3 \
&searchClientId=fa1c40fe-5664-11e9-9905-f23c91e2022e' \
&sessionID=1557756499744112 \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
Example Response
"{
"status": true,
"message": "Search by Session ID",
"data": [
{
"doc": "https://su-vf-console.ap17.visual.force.com/apex/SU_Vf_Console?ltn_app_id=06m2x000000gQQ2AAM&sfdcIFrameHost=web&isdtp=p1&clc=0&sfdcIFrameOrigin=https://ap17.lightning.force.com&nonce=2b250e95c6f9518ab8a05d3c3c8ce0bfc7e3db869f01053d599afb7b2b6c75f2&tour=#!/search?searchString=console%20test%20replac&from=0&sortby=_score&orderBy=desc&pageNo=1&aggregations=%5B%5D&uid=c45c5a16-73f6-11ea-983c-0242ac120002&resultsPerPage=10&exactPhrase=&withOneOrMore=&withoutTheWords=&pageSize=10&sid=1585734335173518&language=en",
"count": "1"
},
{
"doc": "https://su-vf-console.ap17.visual.force.com/apex/SU_Vf_Console?ltn_app_id=06m2x000000gQQ2AAM&sfdcIFrameHost=web&isdtp=p1&clc=0&sfdcIFrameOrigin=https://ap17.lightning.force.com&nonce=2b250e95c6f9518ab8a05d3c3c8ce0bfc7e3db869f01053d599afb7b2b6c75f2&tour=#!/search?searchString=console%20test&from=0&sortby=_score&orderBy=desc&pageNo=1&aggregations=%5B%5D&uid=c45c5a16-73f6-11ea-983c-0242ac120002&resultsPerPage=10&exactPhrase=&withOneOrMore=&withoutTheWords=&pageSize=10&sid=1585734335173518&language=en",
"count": "1"
}
]
}"
Prints count
discussions that have been accessed the most and can be converted into articles. The data is from between startDate and endDate.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
A decimal number | string | Yes |
Example Request
View 3 most popular discussions between May 1, 2019 and May 5, 2019 that can be converted to articles.
curl -X POST 'https://poc.searchunify.com/c19/api/v2/searchConversion/discussionsreadytobecomearticles' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer d35ad0890e79440686ca893e77ecd89fdf4b289e" \
--data-binary $'{\n "startDate":"2019-04-01", \n"endDate":"2019-05-15", \n"count":"3"}'
Example Response
"{
"status": true,
"message": "Discussions Ready To Become Articles",
"data": [
{
"url": "https://stackoverflow.com/questions/62323564/how-to-check-if-a-specific-script-element-is-async-or-defer-with-puppeteer",
"title": "How to check if a specific script element is async or defer with Puppeteer",
"count": "2"
},
{
"url": "https://stackoverflow.com/questions/43490908/how-to-use-express-validator-to-validate-form-data-with-express-formidable-in-ex",
"title": "How to use express-validator to validate form data with express-formidable in express",
"count": "2"
}
]
}"
View the list of articles that were consulted before a user created a case.
Parameters
Parameter | Optional/Required | Description | Data Type |
---|---|---|---|
from
|
Required | Only the activity on or after from are considered. |
String |
to
|
Required | Only the activity on or before to are considered. |
String |
internalUser
|
Required | Count searches only from internal users. Values: true , false , and all . |
String |
searchType
|
Required | Count searches on the global search page, support page, or both. Values: all , global , and support. |
String |
uid
|
Required | It is your search client ID. If a uid is not specified, then the cumulative data for all your search clients is considered. |
String |
offset
|
Optional | View the results from the number specified in offset . If offset == 5 , then the response will contain results from the fifth page. |
Number |
limit
|
Optional | Number of cases in the result. Default value: 1, Minimum value: 1, Maximum value: 500 | Number |
Request
"curl --location --request POST 'https://company.searchunify.com/api/v2/conversion/articlesCreatedCases' \
--header 'Authorization: Bearer 69a47b388f1dabcdef834bfe6f337413c4866b99' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "2020-11-21",
"to": "2020-12-21",
"internalUser": "all",
"searchType": "all",
"uid": "c6edd36b-bae3-11eb-xyz2-0242ac120009",
"offset":0,
"limit":3
}'"
Response
{
"status": true,
"message": "No Deflection on case submission page - Articles",
"data": [
{
"title": "About Pure Storage Volume Backup ",
"url": "https://docs.company.com/6_1_1/Web/UserGuide/Content/Concepts/BackupConceptPure.htm",
"session_count": "1",
"click_count": "1"
},
{
"title": "company - Network View issue",
"url": "https://prodcopy-company.internal.force.com/s/open-cases?id=50051989014GQ1ZAAW",
"session_count": "1",
"click_count": "1"
},
{
"title": "company network connection questions",
"url": "https://prodcopy-company.internal.force.com/s/open-cases?id=5002J19891Htn06QAB",
"session_count": "1",
"click_count": "1"
},
{
"title": "company networking",
"url": "https://prodcopy-company.internal.force.com/s/open-cases?id=5002J19891LeGEbQAN",
"session_count": "1",
"click_count": "1"
},
{
"title": "Hosting company Views via an HTTPS endpoint on Microsoft IIS does not allow file access",
"url": "https://prodcopy-company.internal.force.com/s/article/Hosting-company-Views-via-an-HTTPS-endpoint-on-Microsoft-IIS-does-not-allow-file-access",
"session_count": "1",
"click_count": "1"
},
{
"title": "How to change the port number for the company Support Channel",
"url": "https://prodcopy-company.internal.force.com/s/article/How-to-change-the-port-number-for-the-company-Support-Channel",
"session_count": "1",
"click_count": "1"
},
{
"title": "How to enable or disable the company Support Channel using the company command line",
"url": "https://prodcopy-company.internal.force.com/s/article/How-to-enable-or-disable-the-company-Support-Channel-using-the-company-command-line",
"session_count": "1",
"click_count": "1"
},
{
"title": "How to replace a NIC on company",
"url": "https://prodcopy-company.internal.force.com/s/article/How-to-replace-a-NIC-on-company",
"session_count": "1",
"click_count": "1"
},
{
"title": "Updating a Cluster's SSL certificate leads to REST API access failures",
"url": "https://prodcopy-company.internal.force.com/s/article/Updating-a-Cluster-s-SSL-certificate-leads-to-REST-API-access-failures",
"session_count": "1",
"click_count": "1"
},
{
"title": "[Networking] Add Replication Networking",
"url": "https://prodcopy-company.internal.force.com/s/open-cases?id=5002J19891J4onPQAR",
"session_count": "1",
"click_count": "1"
},
{
"title": "[Networking] Required Network ports",
"url": "https://prodcopy-company.internal.force.com/s/open-cases?id=5002J19891LeDx4QAF",
"session_count": "1",
"click_count": "1"
}
]
}
Returns the articles that were consulted by users who didn't create a case.
Parameters
Parameter | Optional/Required | Description | Data Type |
---|---|---|---|
from
|
Required | Only the activity on or after from are considered. |
String |
to
|
Required | Only the activity on or before to are considered. |
String |
internalUser
|
Required | Count searches only from internal users. Values: true , false , and all . |
String |
searchType
|
Required | Count searches on the global search page, support page, or both. Values: all , global , and support. |
String |
uid
|
Required | It is your search client ID. If a uid is not specified, then the cumulative data for all your search clients is considered. |
String |
offset
|
Optional | offset is always greater than zero. |
Number |
limit
|
Optional | Number of cases in the result. Default value: 1, Minimum value: 1, Maximum value: 500 | Number |
Request
"curl --location --request POST 'https://company.searchunify.com/api/v2/conversion/articlesDeflectedCase' \
--header 'Authorization: Bearer 69a47b388f1d1db26e834bfe6f337413c4866b99' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "2020-11-21",
"to": "2020-12-21",
"internalUser": "all",
"searchType": "all",
"uid": "c6edd36b-3abe-11eb-b9ab-0242ac120009",
"offset":0,
"limit":3
}'"
Response
{
"status": true,
"message": "Deflection on case submission page - Articles",
"data": [
{
"title": "About Pure Storage Volume Backup ",
"url": "https://docs.company.com/6_1_1/Web/UserGuide/Content/Concepts/BackupConceptPure.htm",
"session_count": "1",
"click_count": "1"
}
]
}
Find out how many articles have been attached to cases.
Parameters
Parameter | Optional/Required | Description | Data Type |
---|---|---|---|
from
|
Required | Only the activity on or after from are considered. |
String |
to
|
Required | Only the activity on or before to are considered. |
String |
internalUser
|
Required | Count searches only from internal users. Values: true , false , and all . |
String |
uid
|
Required | It is your search client ID. If a uid is not specified, then the cumulative data for all your search clients is considered. |
String |
offset
|
Optional | View the results from the number specified in offset . If offset == 5 , then the response will contain results from the fifth page. |
Number |
limit
|
Optional | Number of cases in the result. Default value: 1, Minimum value: 1, Maximum value: 500 | Number |
Request
"curl --location --request POST 'https://company.searchunify.com/api/v2/conversion/attachedArticles' \
--header 'Authorization: Bearer 69a47b388f1d1db26e834bfe6f337413c4866b99' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "2020-11-21",
"to": "2020-12-21",
"internalUser": "all",
"uid": "c6edd36b-3abe-11eb-b9ab-0242ac120009",
"offset":0,
"limit":3
}'"
Response
{
"status": true,
"message": "Attached to case - Articles",
"data": [
{
"article_title": "(Internal) How to convert RF1 to RF2/RF3/EC in Cloud Edition (AWS/GCP) clusters",
"article_url": "https://support.company.com/s/article/internal-How-to-convert-RF1-to-RF2-RF3-EC-in-Cloud-Edition-AWS-GCP-clusters",
"case_count": "1"
},
{
"article_title": "1st TEST HOPE case - STEPHEN TEST",
"article_url": "https://support.company.com/s/article/1st-TEST-HOPE-case--STEPHEN-TEST",
"case_count": "1"
}
]
}
From the article URL, find out which cases it has been attached to.
Parameters
Parameter | Optional/Required | Description | Data Type |
---|---|---|---|
from
|
Required | Only the activity on or after from are considered. |
String |
to
|
Required | Only the activity on or before to are considered. |
String |
url
|
Required | The URL of the article. | String |
uid
|
Required | It is your search client ID. If a uid is not specified, then the cumulative data for all your search clients is considered. |
String |
offset
|
Optional | offset is always greater than zero. |
Number |
limit
|
Optional | Number of cases in the result. Default value: 1, Minimum value: 1, Maximum value: 500 | Number |
Request
"curl --location --request POST 'https://company.searchunify.com/api/v2/conversion/attachedOnCase' \
--header 'Authorization: Bearer 69a47b388f1d1db26e834bfe6f337413c4866b99' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "2020-11-21",
"to": "2020-12-21",
"url": "abdecfghijkl%40%40%40___en_US",
"uid": "abcdefghijklmn",
"offset":0,
"limit":3
}'"
Response
{
"status": true,
"message": " Attached to case - Cases",
"data": [
{
"case_subject": "test case created by SU team",
"case_number": "00255239"
}
]
}
Content Gap Analytics
Prints a list of the count
search queries that failed to fetch any results. For count=5
, you will get 5 results. The data is from between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
Decimal literals | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
View no-result searches. The data is from between May 1, 2019 and May 5, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchQuery/withNoClicks? \
startDate=2019-05-01&endDate=2019-05-05&count=3&searchClientId=fa1c40fe-5664-11e9-9905-f23c91e2022e' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
Example Response
[
{
"value": "install searchunify",
"count": 5
},
{
"value": "servicenow content source",
"count": 4
},
{
"value": "servicenow",
"count": 3
}
]
Prints a list of the count
search sessions and the searches conducted in each session. For count=5
, you will get 5 results. The data is from between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
Decimal literals | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
View searches categorized by sessions between May 1, 2019 and May 5, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
curl -X GET 'https://mycompany.searchunify.com/api/v2/searchSession/all/searchQuery? \
startDate=2019-05-01&endDate=2019-05-05&count=3&searchClientId=fa1c40fe-5664-11e9-9905-f23c91e2022e' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
Example Response
"{
"status": true,
"message": "search session all data",
"data": [
{
"logs": [
{
"query": "nioo",
"count": 1
},
{
"query": "no checked",
"count": 1
}
],
"sessionId": "1588773027100789"
},
{
"logs": [
{
"query": "data",
"count": 1
},
{
"query": "testing the multiple case issue",
"count": 1
},
{
"query": "case creation",
"count": 1
}
],
"sessionId": "1588826241406025"
},
{
"logs": [
{
"query": "issue",
"count": 1
}
],
"sessionId": "1588834919394513"
}
]
}
Prints a list of the count
queries in a search session and the documents accessed during that session. For count=5
, you will get 5 results. The data is from between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
count
|
Decimal literals | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
View the query and search data linked with a session between May 1, 2019 and May 5, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
and search session ID 1557756499744112
.
curl -X GET 'https://mycompany.searchunify.com/api/v2/ \
searchSession/bySearchSessionId/{{searchSessionId}}? \
startDate=2019-05-01&endDate=2019-05-05&count=3 \
&searchClientId=fa1c40fe-5664-11e9-9905-f23c91e2022e' \
&sessionID=1557756499744112 \
-H 'Content-Type: application/json' \
-H "authorization: Bearer 0d763196b4873064e348570c01cbd0a02f370935"
Example Response
"{
"status": true,
"message": "session detail data",
"data": [
{
"sessionId": "15857298577174660",
"logs": [
{
"query": "your",
"count": "1",
"conversions": [
{
"doc": "https://chand15-dev-ed--su-vf-internal.visualforce.com/apex/SU_Vf_Internal?sfdc.tabName=01r0o000001Bmcq&vfRetURLInSFX=/home/home.jsp<n_app_id=06m0o000001HPL7AAO&nonce=770acd7a5421e58b6a3b4f70b3efb81f37fbd4ffef5b5dcd4129f005db97d903&sfdcIFrameOrigin=https://chand15-dev-ed.lightning.force.com&tour=&isdtp=p1&sfdcIFrameHost=web&clc=1#!/search?searchString=your&from=0&sortby=_score&orderBy=desc&pageNo=1&aggregations=%5B%5D&uid=20557598-73ef-11ea-983c-0242ac120002&resultsPerPage=10&exactPhrase=&withOneOrMore=&withoutTheWords=&pageSize=10&sid=1585729857718403&language=en",
"count": "2"
}
]
},
{
"query": "your unboxing",
"count": "1",
"conversions": [
{
"doc": "https://chand15-dev-ed--su-vf-internal.visualforce.com/apex/SU_Vf_Internal?sfdc.tabName=01r0o000001Bmcq&vfRetURLInSFX=/home/home.jsp<n_app_id=06m0o000001HPL7AAO&nonce=770acd7a5421e58b6a3b4f70b3efb81f37fbd4ffef5b5dcd4129f005db97d903&sfdcIFrameOrigin=https://chand15-dev-ed.lightning.force.com&tour=&isdtp=p1&sfdcIFrameHost=web&clc=1#!/search?searchString=your%20unboxing&from=0&sortby=_score&orderBy=desc&pageNo=1&aggregations=%5B%5D&uid=20557598-73ef-11ea-983c-0242ac120002&resultsPerPage=10&exactPhrase=&withOneOrMore=&withoutTheWords=&pageSize=10&sid=1585729857718403&language=en",
"count": "1"
}
]
}
]
}
]
}"
Prints the number of articles generated on your cases between startDate
and endDate
on a search client whose ID is searchClientID
. If the searchClientID
is not specified, then the call fetches data from all the search clients.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
searchClientId
|
abcdefgh-ijkl-mnop-qrst-uvwzyzABCDEF
|
string | No |
Example Request
searchQuery/kcsSupport between April 1, 2019 and May 15, 2019 on a search client with the ID fa1c40fe-5664-11e9-9905-f23c91e2022e
.
curl -X POST 'https://mycompany.searchunify.com/api/v2/searchQuery/kcsSupport' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer d35ad0890e79440686ca893e77ecd89fdf4b289e" \
--data-binary $'{\n "startDate":"2019-04-01", \n"endDate":"2019-05-15", \
\n"uid":"fa1c40fe-5664-11e9-9905-f23c91e2022e"\n}'
Example Response
{
"status": true,
"message": "kcs support",
"data": [
{
"case_url": "https://su-vf-console.ap16.visual.force.com/5002w000001TbVm",
"Case": "Maintenance guidelines for generator unclear",
"Count": "2"
},
{
"case_url": "https://su-vf-console.ap16.visual.force.com/apex/SU_Vf_Console?isdtp=vw&sfdcIFrameOrigin=https%3A%2F%2Fap16.salesforce.com&nonce=dd3e7c52264b0bf8298256a99c828513c04642ffa739fb2a4715257d840fbd9a",
"Case": "Maintenance guidelines for generator unclear",
"Count": "1"
},
{
"case_url": "https://su-vf-console.ap16.visual.force.com/5002w000003jTeKAAU",
"Case": "test 12 test",
"Count": "1"
}
]
}
Provides search, conversion, page views, case deflection, and case creation data for the argument caseUid
.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
caseUid
|
f6fd35e5-b6ba-9077-2f34336bd9cb | string | Yes |
Example Request
curl -X POST 'https://company.searchunify.com/api/v2/searchSession/byCaseUid'
-H 'Content-Type:application/json'
-H "authorization: Bearer e7367532ab4c5c8c51062f4a8d03079f1a35f705"
--data-binary $'{\n "startDate":"2019-05-01", \n"endDate":"2019-05-30",
\n"caseUid":"f6fd35e5-b6ba-9077-2f34336bd9cb"}'
Example Response
{
"status": true,
"message": "search case Uid data",
"data": [
{
"name": "Search",
"data": [
{
"start": 1587913337000,
"end": 1587913826000,
"count": 4,
"doc": [
{
"text_entered": "testing",
"ts": 1587913347000
},
{
"text_entered": "new testing",
"ts": 1587913713000
},
{
"text_entered": "data",
"ts": 1587913832000
},
{
"text_entered": "data",
"ts": 1587913826000
}
]
}
],
"totalCount": 1
},
{
"name": "Conversions",
"data": [
{
"start": 1587913337000,
"end": 1587913826000,
"count": 1,
"doc": [
{
"title": "data",
"ts": 1587913826000,
"window_url": "https://grazitti222-developer-edition.ap15.force.com/s/contactsupport"
}
]
}
],
"totalCount": 1
}
]
}
Logs
Returns in-depth session and user activity details.
Parameters
Parameter | Format | Type | Essential |
startDate
|
YYYY-MM-DD | string | Yes |
endDate
|
YYYY-MM-DD | string | Yes |
uid
|
f6fd35e5-b6ba-9077-2f34336bd9cb | string | Yes |
count | Decimal literals | int | No |
supportFilter | Values: All, Yes, No | string | No |
caseFilter | Values: All, Yes, No | string | No |
clickFilter | Values: All, Yes, No | string | No |
searchFilter | Values: All, Yes, No | string | No |
Example Request
curl
--location 'https://XYZ.searchunify.com/api/v2/session/log/all? \
startDate=2023-01-01 \
&endDate=2023-05-01 \
&count=500 \
&uid=04914c93-5801-11ec-88d9-0242ac120002&startIndex=1' \
--header 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxx'