devstack - how to reduce openstack keystone X-Subject-Token size - openstack-keystone

Through devstack I have installed openstack.
I issued following command to get token
curl -i -H "Content-Type: application/json" -d '{ "auth": { "identity": { "methods": ["password"], "password": { "user": { "name": "admin", "domain": { "id": "default" }, "password": "test123" } } } } }' "http://localhost/identity/v3/auth/tokens" ; echo
HTTP/1.1 201 Created
Date: Fri, 04 May 2018 10:45:28 GMT
Server: Apache/2.4.18 (Ubuntu)
X-Subject-Token: gAAAAABa7DnIU_mCvOZ6voN53Ff41dzhTZd1k4-6aju6nVmgmjwgFYe5NioTK6mkCoRP29BIzwXcAMElFU1X9Pc119f16Y98fFMKzh14Rol4TEtLasxl5x4L7oKgnbLGXD-STMbq8MGq860B1a4xPAU0YyDsFu3ERw
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 312
x-openstack-request-id: req-8a0cf0e2-70a1-40dd-8318-890ada890a64
Connection: close
How do i reduce X-Subject-Token size to 32 bit.
I have tried to reduce the size by setting max_token_size from lib/keystone config file by changing default value to 32 size
iniset $KEYSTONE_CONF DEFAULT max_token_size 16384
to
iniset $KEYSTONE_CONF DEFAULT max_token_size 32
After changing token size getting same token length.
Could anyone help me on how to reduce the size.
Thanks.

Related

ms bot service, Is it possible to update both text and attachments? Encounter with `Activity resulted into multiple skype activities`

I have a demand to update past chat items which is send to bot.
I use the following API to update activity.
https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#update-activity
I successfully updated the message when I request like this.
~~~ REQUEST ~~~
PUT /jp/v3/conversations/conversationID/activities/activityID HTTP/1.1
HOST : smba.trafficmanager.net
HEADERS:
Accept: application/json;charset=utf-8
Authorization: Bearer Token
Content-Type: application/json;charset=utf-8
User-Agent: go-resty/2.3.0 (https://github.com/go-resty/resty)
BODY :
{
"text": "lllllll\u003cp\u003e\u003cbr\u003e\u003c/p\u003e\\n\u003cdiv\u003e\u003cimg width=\"386\" height=\"476\" src=\"https://host.jp.ngrok.io/api/v1/images?item_id=01TPIDETFC2MITU7PJFJHYUZEZYJBOMWCL\u0026group_id=f64dd886-4edf-4b23-8f51-c6720042807d\u0026token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJib3RfaWQiOjEsImdyb3VwX2lkIjoiZjY0ZGQ4ODYtNGVkZi00YjIzLThmNTEtYzY3MjAwNDI4MDdkIiwiaXRlbV9pZCI6IjAxVFBJREVURkMyTUlUVTdQSkZKSFlVWkVaWUpCT01XQ0wiLCJhdWQiOiJ3b3JrcGxhY2UuYmVkb3JlLmpwIiwiaWF0IjoxNjY0MzQzNDg2LCJpc3MiOiJ3b3JrcGxhY2UuYmVkb3JlLmpwIiwibmJmIjoxNjY0MzQzNDg2fQ.MZKEurQeBqP71iEcdxuiG342ZDvhMZ-QxqYnJYvbhmM\"/\u003e\u003c/div\u003e\\n\u003cp\u003e\u003cbr\u003e\u003c/p\u003e",
"type": "message",
"id": "1664769144846"
}
------------------------------------------------------------------------------
~~~ RESPONSE ~~~
STATUS : 200 OK
PROTO : HTTP/1.1
RECEIVED AT : 2022-10-03T15:30:50.642248+09:00
TIME DURATION: 434.921ms
HEADERS :
Content-Length: 22
Content-Type: application/json; charset=utf-8
Date: Mon, 03 Oct 2022 06:30:49 GMT
Ms-Cv: QxMPXxpyPk2IcBQOtkyErA.0
Server: Microsoft-HTTPAPI/2.0
BODY :
{
"id": "1664769144846"
}
And I failed when I request like this.
2022/10/03 15:32:45.241320 DEBUG RESTY
==============================================================================
~~~ REQUEST ~~~
PUT /jp/v3/conversations/conversationID/activities/activityID HTTP/1.1
HOST : smba.trafficmanager.net
HEADERS:
Accept: application/json;charset=utf-8
Authorization: Bearer Token
Content-Type: application/json;charset=utf-8
User-Agent: go-resty/2.3.0 (https://github.com/go-resty/resty)
BODY :
{
"text": "lllllll\u003cp\u003e\u003cbr\u003e\u003c/p\u003e\\n\u003cdiv\u003e\u003cimg width=\"386\" height=\"476\" src=\"https://host.jp.ngrok.io/api/v1/images?item_id=01TPIDETFC2MITU7PJFJHYUZEZYJBOMWCL\u0026group_id=f64dd886-4edf-4b23-8f51-c6720042807d\u0026token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJib3RfaWQiOjEsImdyb3VwX2lkIjoiZjY0ZGQ4ODYtNGVkZi00YjIzLThmNTEtYzY3MjAwNDI4MDdkIiwiaXRlbV9pZCI6IjAxVFBJREVURkMyTUlUVTdQSkZKSFlVWkVaWUpCT01XQ0wiLCJhdWQiOiJ3b3JrcGxhY2UuYmVkb3JlLmpwIiwiaWF0IjoxNjY0MzQzNDg2LCJpc3MiOiJ3b3JrcGxhY2UuYmVkb3JlLmpwIiwibmJmIjoxNjY0MzQzNDg2fQ.MZKEurQeBqP71iEcdxuiG342ZDvhMZ-QxqYnJYvbhmM\"/\u003e\u003c/div\u003e\\n\u003cp\u003e\u003cbr\u003e\u003c/p\u003e",
"type": "message",
"id": "1664769144846",
"attachments": [
{
"contentType": "image/png",
"contentUrl": "https://via.placeholder.com/750",
"name": "placeholder"
}
]
}
------------------------------------------------------------------------------
~~~ RESPONSE ~~~
STATUS : 400 Bad Request
PROTO : HTTP/1.1
RECEIVED AT : 2022-10-03T15:32:45.241272+09:00
TIME DURATION: 84.414125ms
HEADERS :
Content-Length: 91
Content-Type: application/json; charset=utf-8
Date: Mon, 03 Oct 2022 06:32:44 GMT
Ms-Cv: kn6QMv/UH0iJhMXfL0s1HA.0
Server: Microsoft-HTTPAPI/2.0
BODY :
{
"error": {
"code": "BadSyntax",
"message": "Activity resulted into multiple skype activities"
}
}
It looks that it is impossible to update text and attachments at the same time. It is necessary for us to update both text and attachments within one request for sending only attachments will erase text info.
Does anyone know the reason about **Activity resulted into multiple skype activities**?

Simple example for adding relationships between Atlas entities?

What is the correct way to use the REST API to add a relationship between entities in apache atlas? Looking at the docs for the REST API, I find it difficult to tell what some of the fields mean, which are required or not (and what happens if they are not entered), or what default values should be (since the examples use what appear to be placeholder values (eg. what is provenanceType or the propagateTags field appears to expect some kind of enumeration value, but never specifies valid options)).
Could someone provide any example of what this would look like in real / valid values? Eg. if had 2 entities E1 and E2 already added to Atlas and wanted to establish a relationship between the two, would want to do something like...
curl -X POST --header 'Content-Type: application/json;charset=UTF-8' --header 'Accept: application/json' -d '{<simplified json>}' 'https://atlas-server-hostname:21000/v2/relationship'
Trying
[hph_etl#HW03 ~]$ curl -vv -u admin:admin -X POST --header 'Content-Type: application/json;charset=UTF-8' --header 'Accept: application/json' -d '{ \
"createTime": 1565135406, \
"createdBy": "hph_etl", \
"end1": { \
"guid": "2ddcda5b-2489-4636-a9ab-12b199c02422", \
"typeName": "hdfs_path" \
}, \
"end2": { \
"guid": "a33f45de-13d0-4a30-9df7-b0e02eb0dfd5", \
"typeName": "hdfs_path" \
}, \
"guid": "2ddcda5b-2489-4636-a9ab-12b199c02422", \
"propagateTags": "TWO_TO_ONE", \
"status": "ACTIVE", \
"typeName": "hdfs_path" \
}' 'http://HW03.co.local:21000/api/atlas/v2/relationship'
* About to connect() to HW03.co.local port 21000 (#0)
* Trying 172.18.4.48...
* Connected to HW03.co.local (172.18.4.48) port 21000 (#0)
* Server auth using Basic with user 'admin'
> POST /v2/relationship HTTP/1.1
> Authorization: Basic xxxxxx
> User-Agent: curl/7.29.0
> Host: HW03.co.local:21000
> Content-Type: application/json;charset=UTF-8
> Accept: application/json
> Content-Length: 442
>
* upload completely sent off: 442 out of 442 bytes
< HTTP/1.1 404 Not Found
< Date: Wed, 07 Aug 2019 01:07:44 GMT
< Set-Cookie: ATLASSESSIONID=xxxxxx;Path=/;HttpOnly
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Content-Type: text/html;charset=utf-8
< Content-Length: 2265
< Server: Jetty(9.3.14.v20161028)
<
<!doctype html>
<!--
....
*
* http://www.apache.org/licenses/LICENSE-2.0
....
-->
<!--[if gt IE 8]>
<script type="text/javascript">
function Redirect() {
window.location.assign("login.jsp");
}
Redirect();
</script>
<![endif]-->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if gt IE 7]>
<script src="js/external_lib/es5-shim.min.js"></script>
<script src="js/external_lib/respond.min.js"></script>
<![endif]-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Atlas</title>
....
</head>
<body>
<div id="wrapper">
<!-- Page Content Begin -->
<div id="page-content-wrapper">
<div class="page-title clearfix">
<h3>Looking for something?</h3>
<p>We're sorry. The web address you're looking for is not a functioning page in Apache Atlas. Please try navigating from Apache Atlas Home</p>
</div>
</div>
<!-- Page Content End -->
</div>
</body>
</html>
* Connection #0 to host HW03.co.local left intact
does not work and not sure what to do about the error message. Even the simple example of
curl -vv -u admin:admin -X POST --header 'Content-Type: application/json;charset=UTF-8' --header 'Accept: application/json' -d '{ \
"end1": { \
"guid": "2ddcda5b-2489-4636-a9ab-12b199c02422" \
}, \
"end2": { \
"guid": "a33f45de-13d0-4a30-9df7-b0e02eb0dfd5" \
}, \
"typeName": "AtlasRelationshipDef" \
}' 'http://HW03.ucera.local:21000/api/atlas/v2/relationship'
throws a similarly uninformative error
* upload completely sent off: 211 out of 211 bytes
< HTTP/1.1 500 Internal Server Error
< Date: Mon, 12 Aug 2019 19:57:44 GMT
< Set-Cookie: ATLASSESSIONID=xxxxxx;Path=/;HttpOnly
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Server: Jetty(9.3.14.v20161028)
<
* Connection #0 to host HW03.co.local left intact
There was an error processing your request. It has been logged (ID 6d64bc3a1a910e46)
Checking the logs in /var/logs/atlas/application.log on the atlas host server, I can see yet another uninformative error message...
[hph_etl#HW03 atlas]$ cat application.log | grep -C 2 6d64bc3a1a910e46
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2019-08-12 09:57:44,880 ERROR - [pool-2-thread-10 - 8a5535b1-6544-4f9b-b3ad-8bec5e8d6fcd:] ~ Error handling a request: 6d64bc3a1a910e46 (ExceptionMapperUtil:32)
javax.ws.rs.WebApplicationException
at com.sun.jersey.server.impl.uri.rules.TerminatingRule.accept(TerminatingRule.java:66)
Note that for getting the guids required for the relationship linking, even Hortonworks seems to provide only a poor solution.
What could be going wrong here? Are there any better docs than those linked to for understanding the API?
Atlas relationship between existing entities can be created either using entity GUIDs or uniqueAttributes in end1 and end2 which can be qualifiedName or any other unique attribute .
Please do note that top level typeName is the relationship def typeName while typeName inside end1 and end2 is entity typeName.
In case of relationship between hive_table and hive_db the relationship def typeName is: hive_table_db
So, if you want to create a relationship between hive_table and hive_db, the request would be:
POST: /api/atlas/v2/relationship
{
"typeName": "hive_table_db",
"end1": {
"typeName": "hive_table",
"uniqueAttributes": {
"qualifiedName": "db.table#cluster"
}
},
"end2": {
"typeName": "hive_db",
"uniqueAttributes": {
"qualifiedName": "db#cluster"
}
}
}
For predefined Atlas types you can find the relationship typeName from its definition inside relationshipAttributeDefs field
GET: /api/atlas/v2/types/typedef/name/hive_db
Which gives the following response:
{
"category": "ENTITY",
"guid": "78c44290-2ed8-461b-953d-3965d9bb44ca",
"createdBy": "root",
"updatedBy": "root",
"createTime": 1548175553859,
"updateTime": 1548175822249,
"version": 2,
"name": "hive_db",
"description": "hive_db",
"typeVersion": "1.2",
"serviceType": "hive",
"attributeDefs": [
{
"name": "clusterName",
"typeName": "string",
"isOptional": false,
"cardinality": "SINGLE",
"valuesMinCount": 1,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": true,
"includeInNotification": true,
"searchWeight": -1
},
{
"name": "location",
"typeName": "string",
"isOptional": true,
"cardinality": "SINGLE",
"valuesMinCount": 0,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false,
"searchWeight": -1
},
{
"name": "parameters",
"typeName": "map<string,string>",
"isOptional": true,
"cardinality": "SINGLE",
"valuesMinCount": 0,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false,
"searchWeight": -1
},
{
"name": "ownerType",
"typeName": "hive_principal_type",
"isOptional": true,
"cardinality": "SINGLE",
"valuesMinCount": 0,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false,
"searchWeight": -1
}
],
"superTypes": [
"Asset"
],
"subTypes": [],
"relationshipAttributeDefs": [
{
"name": "tables",
"typeName": "array<hive_table>",
"isOptional": true,
"cardinality": "SET",
"valuesMinCount": -1,
"valuesMaxCount": -1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false,
"searchWeight": -1,
"constraints": [
{
"type": "ownedRef"
}
],
"relationshipTypeName": "hive_table_db",
"isLegacyAttribute": false
},
{
"name": "ddlQueries",
"typeName": "array<hive_db_ddl>",
"isOptional": true,
"cardinality": "SET",
"valuesMinCount": -1,
"valuesMaxCount": -1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false,
"searchWeight": -1,
"constraints": [
{
"type": "ownedRef"
}
],
"relationshipTypeName": "hive_db_ddl_queries",
"isLegacyAttribute": false
},
{
"name": "meanings",
"typeName": "array<AtlasGlossaryTerm>",
"isOptional": true,
"cardinality": "SET",
"valuesMinCount": -1,
"valuesMaxCount": -1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false,
"searchWeight": -1,
"relationshipTypeName": "AtlasGlossarySemanticAssignment",
"isLegacyAttribute": false
}
]
}
Further, you need to make sure the typeName in end1 and end2 is as per the relationship def, which you can check in type definition:
GET: /api/atlas/v2/types/typedef/name/hive_table_db
{
"category": "RELATIONSHIP",
"guid": "79257a2c-407c-4c0b-b3ae-04b1b3a8d649",
"createdBy": "root",
"updatedBy": "root",
"createTime": 1548175553894,
"updateTime": 1548175553894,
"version": 1,
"name": "hive_table_db",
"description": "hive_table_db",
"typeVersion": "1.0",
"serviceType": "hive",
"attributeDefs": [],
"relationshipCategory": "COMPOSITION",
"propagateTags": "NONE",
"endDef1": {
"type": "hive_table",
"name": "db",
"isContainer": false,
"cardinality": "SINGLE",
"isLegacyAttribute": true
},
"endDef2": {
"type": "hive_db",
"name": "tables",
"isContainer": true,
"cardinality": "SET",
"isLegacyAttribute": false
}
}
curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin 'http://localhost:21000/api/atlas/v2/relationship' -d '
{
"typeName": "???",
"end1": {"guid" : ""},
"end2": {"guid" : ""}
}
'
1. How to fullfil <???>
go to http://localhist:21000/api/atlas/v2/types/typedef/name/<YOUR ENTITY>
to find relationshipAttributeDefs for this ENTITY
You need "relationshipTypeName" where "rdbms_foreign_key_column_references"="???"
2. than exec
curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -u admin:admin 'http://localhost:21000/api/atlas/v2/relationship' -d '
{
"typeName": "rdbms_foreign_key_column_references",
"end1": {"guid" : ""},
"end2": {"guid" : ""}
}
'
you will have error
"errorMessage":"Relationship end is invalid. Expected rdbms_foreign_key but is NULL"
where you will know the needs ENTITY

Google Fitness API returning Error 500

Is someone aware that the Google Fitness API is returning Error 500, at least for the endpoint:
https://www.googleapis.com/fitness/v1/users/me/dataset ?
I was testing my app, and keep getting Error 500 since about 7 hours ago. also have tried the Google API Explorer for the same method (taken the necessary previews steps for authorisation):
https://developers.google.com/apis-explorer/?hl=en_US#p/fitness/v1/fitness.users.dataset.aggregate?userId=me&_h=2&resource=%257B%250A++%2522aggregateBy%2522%253A+%250A++%255B%250A++%255D%252C%250A++%2522endTimeMillis%2522%253A+%25221529467200000%2522%252C%250A++%2522startTimeMillis%2522%253A+%25221529899200000%2522%250A%257D&
And this is the reponse:
cache-control: private, max-age=0
content-encoding: gzip
content-length: 122
content-type: application/json; charset=UTF-8
date: Thu, 28 Jun 2018 17:12:12 GMT
expires: Thu, 28 Jun 2018 17:12:12 GMT
server: GSE
vary: Origin, X-Origin
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
I landed here when I was navigating looking for Google Support from the Google API Explorer page. So, I hope someone sees this :)

How to create a Git repository through projects.repos.create api?

The question is very simple but I’m only getting errors :
POST https://sourcerepo.googleapis.com/v1/projects/<example>/repos?key={YOUR_API_KEY}
{
"name": ">repos>"
}
Which gives :
HTTP/400
cache-control: private
content-encoding: gzip
content-length: 251
content-type: application/json; charset=UTF-8
date: Thu, 15 Feb 2018 22:46:47 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.LocalizedMessage",
"locale": "en-US",
"message": "Invalid repo name: repos. Must be of the form projects/<project>/repos/<repo>"
}
]
}
}
Where example is an existing project and repos is the repository name I want to create.
What am I missing ? I failed to find an example of working code.
This is the most important part of the error:
{
....
"message": "Invalid repo name: repos. Must be of the form projects/<project>/repos/<repo>"
....
}
Which tells you that the format of the name field is not correct. Let's say you have this settings:
Project: your-project-name
Repo: desired-repo-name
Then your request body must be:
{
"name": "projects/your-project-name/repos/desired-repo-name"
}
After executing you'll receive the confirmation:
200
cache-control: private
content-encoding: gzip
content-length: 77
content-type: application/json; charset=UTF-8
date: Wed, 21 Feb 2018 11:12:46 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"name": "projects/your-project-name/repos/desired-repo-name"
}

Does Bing spell check API have an additional length restriction for mode = spell?

The Bing spell check API has a 10,000 char limit for the chunk of text that the request would like to do a spell check [mode=spell] or proof read [mode=proof(default)].
However I am running into an issue where a chunk of misspelt text clearly under the limit of 10k, does not return back with flagged tokens in a spell check request, but does return back in the proof read request.
What gives? Is there a lower limit for Spell check?
Output for both requests below. I am using POST in both cases and both responses return a 200 OK
Mode: spell
Request:
POST
https://api.cognitive.microsoft.com/bing/v5.0/spellcheck/?mode=spell
HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host:
api.cognitive.microsoft.com Ocp-Apim-Subscription-Key:
••••••••••••••••••••••••••••••••
Text=This is a long sentance with some mistakes in here. its supposed
to be a question but i can’t think of a long question. maybe that
means i don’t have something selious to ask?
Response:
Vary: Accept-Encoding BingAPIs-TraceId:
2802E335D1A04D22865FCA6039E61233 X-MSEdge-ClientID:
3F1CA016365F6B862DF6AA10376E6A50 X-MSAPI-UserState: 97c3
BingAPIs-Market: en-US X-MSEdge-Ref: Ref A:
2802E335D1A04D22865FCA6039E61233 Ref B:
E62A760E2E5891B3D022742C51159258 Ref C: Tue Jan 10 13:44:58 2017 PST
apim-request-id: 7b94e044-d1fe-4bbc-a153-4d4e5ef30586
Strict-Transport-Security: max-age=31536000; includeSubDomains;
preload Cache-Control: max-age=0, private Date: Tue, 10 Jan 2017
21:44:57 GMT P3P: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR
IND" Content-Length: 44 Content-Type: application/json; charset=utf-8
Expires: Tue, 10 Jan 2017 21:43:57 GMT
{ "_type": "SpellCheck", "flaggedTokens": [] }
Mode: proof
Request:
POST
https://api.cognitive.microsoft.com/bing/v5.0/spellcheck/?mode=proof
HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host:
api.cognitive.microsoft.com Ocp-Apim-Subscription-Key:
••••••••••••••••••••••••••••••••
Text=This is a long sentance with some mistakes in here. its supposed
to be a question but i can’t think of a long question. maybe that
means i don’t have something selious to ask?
Response:
Vary: Accept-Encoding BingAPIs-TraceId:
627B24C4E6D148E1B441F29A4872942B X-MSEdge-ClientID:
33F31CBFF80462EB27B316B9F935630A X-MSAPI-UserState: 983f
BingAPIs-Market: en-US X-MSEdge-Ref: Ref A:
627B24C4E6D148E1B441F29A4872942B Ref B:
79AB388A3DFCBD481B71DB909B097DC3 Ref C: Tue Jan 10 13:46:16 2017 PST
apim-request-id: 645f3de5-6823-40d1-aea6-312e10d1eee2
Strict-Transport-Security: max-age=31536000; includeSubDomains;
preload Cache-Control: max-age=0, private Date: Tue, 10 Jan 2017
21:46:16 GMT P3P: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR
IND" Content-Length: 700 Content-Type: application/json; charset=utf-8
Expires: Tue, 10 Jan 2017 21:45:16 GMT
{
"_type": "SpellCheck",
"flaggedTokens": [
{
"offset": 15,
"token": "sentance",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "sentence",
"score": 0.687877624668787
}
]
},
{
"offset": 86,
"token": "i",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "I",
"score": 0
}
]
},
{
"offset": 137,
"token": "i",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "I",
"score": 0
}
]
},
{
"offset": 52,
"token": "its",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "it's",
"score": 0.830337199488689
}
]
},
{
"offset": 160,
"token": "selious",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "serious",
"score": 0.897224156828521
},
{
"suggestion": "delicious",
"score": 0.687622047694618
}
]
}
]
}
This is a different source of Bing's API, but is probably the source of truth:
https://dev.cognitive.microsoft.com/docs/services/56e73033cf5ff80c2008c679/operations/56e73036cf5ff81048ee6727
Spell - Meant to provide Search engine like spelling corrections. It
will correct small queries(up to length 9 tokens) without any casing
changes and will be more optimized (perf and relevance) towards search
like queries.

Resources