No enterprise was found for the given id - google-apis-explorer

I have a valid Organization created at https://play.google.com/work. When I use the Organization ID available here as Enterprise Id for API calls avaialbe at https://developers.google.com/apis-explorer/#p/androidenterprise/v1/ , I am always getting below response.
404
cache-control: private, max-age=0 content-encoding: gzip content-length: 175 content-type: application/json; charset=UTF-8 date: Mon, 17 Jun 2019 07:47:15 GMT expires: Mon, 17 Jun 2019 07:47:15 GMT server: GSE vary: Origin, X-Origin
{ "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "No enterprise was found for the given id.", "locationType": "parameter", "location": "enterpriseId" } ], "code": 404, "message": "No enterprise was found for the given id." } }
Note: OAuth 2.0 Authorization is on.

This error could arise when the enterprise has already been deleted from Google console (https://play.google.com/work). You can navigate to above URL and in admin settings you can view your enterprise.

Related

Account linking error: "Can't parse the response. The response needs to be JSON format."

I am attempting account linking within 'Actions on Google'. Everything works until my OAuth provider responds to Google's request for tokens.
This is the JSON that is returned and appears to be properly formatted:
{"access_token":"edeaa27e-12b7-43a1-bc7c-e6bbf9af71c3","expires_in":5184000.0,"refresh_token":"4344383b-cf07-4d12-a5c2-44b6481f5f48","token_type":"Bearer"}
This is the error:
{ "#type": "type.googleapis.com/google.identity.accountlinking.type.AccountLinkingError", "errorReason": "Can't parse the response. The response needs to be JSON format.", "response": { ... }, "step": "AUTH_CODE_EXCHANGE" }
Details:
{
"insertId": "-hgv4mfb4b",
"jsonPayload": {
"#type": "type.googleapis.com/google.identity.accountlinking.type.AccountLinkingError",
"errorReason": "Can't parse the response. The response needs to be JSON format.",
"response": {
"status": 200,
"body": "{\"access_token\":\"cdd79134-316d-46ca-8d82-62fc7c35d905\",\"expires_in\":5184000.0,\"refresh_token\":\"fc63ceb3-0a8d-40ac-a1a3-a8cfab110bef\",\"token_type\":\"Bearer\"}"
},
"step": "AUTH_CODE_EXCHANGE"
},
"resource": {
"type": "assistant_action_project",
"labels": {
"project_id": "my-project"
}
},
"timestamp": "2021-07-30T23:15:28.221Z",
"severity": "ERROR",
"logName": "projects/my-project/logs/accountlinking-pa.googleapis.com%2Ferror",
"receiveTimestamp": "2021-07-30T23:15:28.676796217Z"
}
Here is the response from my OAuth provider via curl. This is what Google gets. It looks like properly formatted JSON.
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Cache-Control: private
Cache-Control: private
< Content-Type: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8
< Vary: Accept
Vary: Accept
< Server: Microsoft-IIS/8.5
Server: Microsoft-IIS/8.5
< Request-Context: appId=cid-v1:f494398c-ac65-47c8-84be-65aea2c190a4
Request-Context: appId=cid-v1:f494398c-ac65-47c8-84be-65aea2c190a4
< X-HOST-nonce: 3eTaf/2/7riVVh24uAsUT+KHqcJPq0F2cw7C5ldMkMF4iH5rDbHQEgOp2OU9RaQFr/HjBBEpkKekcCxlmzek5g==
X-HOST-nonce: 3eTaf/2/7riVVh24uAsUT+KHqcJPq0F2cw7C5ldMkMF4iH5rDbHQEgOp2OU9RaQFr/HjBBEpkKekcCxlmzek5g==
< X-Powered-By: ServiceStack/4.040 Win32NT/.NET
X-Powered-By: ServiceStack/4.040 Win32NT/.NET
< X-AspNet-Version: 4.0.30319
X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
< Date: Tue, 03 Aug 2021 03:17:00 GMT
Date: Tue, 03 Aug 2021 03:17:00 GMT
< Content-Length: 155
Content-Length: 155
< x-HOST-proxy: true
x-HOST-proxy: true
< Strict-Transport-Security: max-age=15768000
Strict-Transport-Security: max-age=15768000
{"access_token":"6cff16ee-3b3e-4ecf-9664-51515ede6cc8","expires_in":5184000.0,"refresh_token":"03725df6-8d4c-434a-ab36-adedb43b76d7","token_type":"Bearer"}
Google will not accept the 'expires_in' value above, because it includes a decimal. Not sure if this impacts all values with a decimal or just '.0', but the OAuth spec doesn't seem to specifically exclude such a value. Javascript converts any float with just a 0 after the decimal to a whole number. My issue was that the 3rd party OAuth provider was returning a string including a float that Google would not parse as JSON.

Orion CB: Can't Access Entities via /v2/entities endpoint

While creating a wirecloud wiring using NGSI Source operator, I encountered an error (helpless error) for couple of days, regarding connection to my instance of Orion CB. I can confirm all other NGSI operator settings entered are correct.
Error creating subscription in the context broker server: Connection Error
I however, suspect this error has to do with Orion NOT finding the entities to subscribe the NGSI Source operator. This is because I tried accessing Eindhoven's broker (http://212.159.228.70:1026/) and it works, NGSI Source operator subscription created successfully.
Equally, I get all entities/attributes in the Eindhoven's broker using:
Akil$http http://212.159.228.70:1026/v2/entities
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 15501
Content-Type: application/json
Date: Mon, 13 May 2019 10:20:20 GMT
Fiware-Correlator: b5e5294a-7568-11e9-83c8-0242ac120003
[
{
"NO2": {
"metadata": {},
"type": "Number",
"value": 27.5
},
"Ozon": {
"metadata": {},
"type": "Number",
"value": 59.5
},
"PM1": {
"metadata": {},
"type": "Number",
"value": 8
},
"PM10": {
"metadata": {},
"type": "Number",
"value": 12
},
.
.
}
]
But then I cannot get the entities in my Orion instance using same scenario:
Akil$ http 193.136.xx.xx:53154/v2/entities
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 2
Content-Type: application/json
Date: Mon, 13 May 2019 10:36:13 GMT
Fiware-Correlator: ee22e4b2-756a-11e9-afa1-0242ac160007
[]
Return empty list, whereas I have available 2 FIWARE services: environment and urbansense. The entities I want to access are available with the urbansense fiware-service having /basic fiware-servicepath.
Service health:
Akil$ http 193.136.xx.xx:53154/version
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 345
Content-Type: application/json
Date: Mon, 13 May 2019 10:50:13 GMT
Fiware-Correlator: e32bf3da-756c-11e9-9371-0242ac160007
{
"orion": {
"compile_time": "Tue Feb 12 10:51:10 UTC 2019",
"compiled_by": "root",
"compiled_in": "4f8128ac7b5b",
"doc": "https://fiware-orion.rtfd.io/",
"git_hash": "7ae8c69b97cd875236b952322a6bd503debbd13d",
"release_date": "Tue Feb 12 10:51:10 UTC 2019",
"uptime": "6 d, 18 h, 7 m, 6 s",
"version": "2.1.0-next"
}
}
Questions:
Why can't I access my Orion instance same way I accessed Eindhoven's
broker?
Is this the reason why my wiring for NGSI Source operator
failed, thus reporting subscription error above?
I'm not sure of fully understading your case (specially the relationship with Wirecloud, as I'm not an expert in Wirecloud), but let's try to answer... :)
From:
[GET /v2/entities] Return empty list, whereas I have available 2 FIWARE services: environment and urbansense. The entities I want to access are available with the urbansense fiware-service having /basic fiware-servicepath.
If the entities you want to access are available in a given service and subservice, then you should add then to the GET request. I don't know how the http command works, but if it were curl it would be something like this
curl -H 'fiware-service: environment' and -H 'fiware-servicepath: /basic' http://212.159.228.70:1026/v2/entities

500 Internal Errors using Google's URL shortener service API

I'm trying to complete the JavaScript track on Codecademy, which requires an api key to access Google's URL shortener service. When I try to shorten, whether there or even when using the API's explorer page, I get errors.
POST https://www.googleapis.com/urlshortener/v1/url?key={YOUR_API_KEY}
{
"longUrl": "https://freecodecamp.org"
}
500 Internal Server Error
cache-control: private, max-age=0
content-encoding: gzip
content-length: 122
content-type: application/json; charset=UTF-8
date: Tue, 02 Jan 2018 18:13:54 GMT
expires: Tue, 02 Jan 2018 18:13:54 GMT
server: GSE
vary: Origin, X-Origin
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
Yeah... we're getting that too...
I believe Google Shortening service is currently down...

ETag not updated in PATCH response

I'm testing my application that uses Drive API v2, and I noticed that I'm not
getting a new ETag in the response of a PATCH request.
I made some tests using the Google APIs Explorer. This is the PATCH request:
PATCH https://www.googleapis.com/drive/v2/files/0B-TenPiSMBplMTJnVlYxTEEwQ28?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ...
X-JavaScript-User-Agent: Google APIs Explorer
{
"title": "file.tmp"
}
And this is the beginning of the PATCH response that shows the ETag "EBHN0a_u6Vh64YcTBDNdNyfF7Hs/MTM4MTI2MTIxODY0MQ":
200 OK
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1019
Content-Type: application/json; charset=UTF-8
Date: Tue, 08 Oct 2013 19:46:36 GMT
Etag: "EBHN0a_u6Vh64YcTBDNdNyfF7Hs/MTM4MTI2MTIxODY0MQ"
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: GSE
{
"kind": "drive#file",
"id": "0B-TenPiSMBplMTJnVlYxTEEwQ28",
"etag": "\"EBHN0a_u6Vh64YcTBDNdNyfF7Hs/MTM4MTI2MTIxODY0MQ\"",
"selfLink": "https://content.googleapis.com/drive/v2/files/0B-TenPiSMBplMTJnVlYxTEEwQ28",
"webContentLink": "https://docs.google.com/uc?id=0B-TenPiSMBplMTJnVlYxTEEwQ28&export=download",
"alternateLink": "https://docs.google.com/file/d/0B-TenPiSMBplMTJnVlYxTEEwQ28/edit?usp=drivesdk",
"iconLink": "https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png",
"title": "file.tmp",
But if I do a GET request just after the PATCH:
GET https://www.googleapis.com/drive/v2/files/0B-TenPiSMBplMTJnVlYxTEEwQ28?key={YOUR_API_KEY}
Authorization: Bearer ...
X-JavaScript-User-Agent: Google APIs Explorer
In the response, I get an updated ETag ("EBHN0a_u6Vh64YcTBDNdNyfF7Hs/MTM4MTI2MTU5NjAyNg"):
200 OK
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Encoding: gzip
Content-Length: 1021
Content-Type: application/json; charset=UTF-8
Date: Tue, 08 Oct 2013 19:48:44 GMT
Etag: "EBHN0a_u6Vh64YcTBDNdNyfF7Hs/MTM4MTI2MTU5NjAyNg"
Expires: Tue, 08 Oct 2013 19:48:44 GMT
Server: GSE
{
"kind": "drive#file",
"id": "0B-TenPiSMBplMTJnVlYxTEEwQ28",
"etag": "\"EBHN0a_u6Vh64YcTBDNdNyfF7Hs/MTM4MTI2MTU5NjAyNg\"",
"selfLink": "https://content.googleapis.com/drive/v2/files/0B-TenPiSMBplMTJnVlYxTEEwQ28",
"webContentLink": "https://docs.google.com/uc?id=0B-TenPiSMBplMTJnVlYxTEEwQ28&export=download",
"alternateLink": "https://docs.google.com/file/d/0B-TenPiSMBplMTJnVlYxTEEwQ28/edit?usp=drivesdk",
"iconLink": "https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png",
"title": "file.tmp",
Is this the intended behavior? I was expecting to get the updated ETag in the
PATCH response to avoid another roundtrip to the server. Notice also that I
experienced the same behavior using PUT instead of PATCH.
Sadly, Drive is somewhat asynchronous under the hood. Stuff like etags and some URLs are populated asynchronously after your PATCH has completed.

Valid JSON format to share text to a particular contact in Google Glass Mirror API?

I'm playing around with Google Mirror API and creating out some sample apps. Since I'm not an explorer I'm using Sturm's Mirror API.
I'd like to know the valid JSON format to share a piece of text to a particular Google Glass contact. I tried the following JSON in API explorer but got a 400 bad request error. Also is there a way to do the same through Google Glass Playground rather than API explorer?
{
'recipients': [
{
'acceptTypes': [
'text/plain'
],
'displayName': 'myglassapp',
'imageUrls': [
'https://myglassapp.appspot.com/images/welcome.jpg'
],
'id': 'babu_glass_app'
}
],
'kind': 'mirror#timelineItem',
'isDeleted': False,
'text' : 'Hello World',
}
Error:
400 Bad Request
- Hide headers -
cache-control: private, max-age=0
content-encoding: gzip
content-length: 118
content-type: application/json; charset=UTF-8
date: Thu, 30 May 2013 08:05:47 GMT
expires: Thu, 30 May 2013 08:05:47 GMT
server: GSE
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error"
}
],
"code": 400,
"message": "Parse Error"
}
}
Oops.. My bad. Python dict to JSON problem. False instead of false. And now the card is getting inserted.
{
'recipients': [
{
'acceptTypes': [
'text/plain'
],
'displayName': 'myglassapp',
'imageUrls': [
'https://myglassapp.appspot.com/images/welcome.jpg'
],
'id': 'babu_glass_app'
}
],
'kind': 'mirror#timelineItem',
'isDeleted': false,
'text' : 'Hello World',
}