Sony Camera API - Content URL get request 500, malformed URL? - camera

With the latest Sony Camera API, I'm able to get a list of the contents on the memory card. When I'm trying to download the images using a GET request, I'm getting a 500 error without any descriptive error messages.
I believe there might be something wrong with the URL I'm using for the get request.
This is the first result part of the JSON response from getContentList
{ "id" : 12, "result" : [
[
{
"isPlayable" : "false",
"content" : {
"thumbnailUrl" : "http:\/\/192.168.122.1:8080\/contentstransfer\/thumb\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000",
"original" : [
{
"stillObject" : "raw",
"url" : "http:\/\/192.168.122.1:8080\/contentstransfer\/orgraw\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000",
"fileName" : "_DSC7790.ARW"
}
],
"smallUrl" : "http:\/\/192.168.122.1:8080\/contentstransfer\/vga\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000",
"largeUrl" : "http:\/\/192.168.122.1:8080\/contentstransfer\/scn\/index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000"
},
"fileNo" : "7790",
"isBrowsable" : "false",
"isProtected" : "",
"title" : "",
"contentKind" : "still",
"createdTime" : "2017-01-12T13:49:00-08:00",
"folderNo" : "100",
"uri" : "image:content?contentId=index%3A%2F%2F1000%2F00000001-default%2F00000044-00000AF2_68_1_1000"
},
The url is encoded, but when I decode it I'm getting this for the thumbnailUrl:
http://192.168.122.1:8080/contentstransfer/thumb/index://1000/00000001-default/00000043-00000AF0_67_1_1000
Of course that is giving me a 500 error, but I believe the characters after thumb must be some URL for the camera to internally parse. So instead I'm just removing the back slashes to get this:
http://192.168.122.1:8080/contentstransfer/thumb/index%3A%2F%2F1000%2F00000001-default%2F00000043-00000AF0_67_1_1000
This still also gives me a 500 error. I'm not sure how else I'm supposed to use this URL. All the API documentation and references just say do a GET request, but the URL that comes in the JSON is not working.

I can only spoke for me: I want video-data instead of thumbnail-data and I just used the url as given through their "result" JSON-Object and I got no problems. For me this looks like this:
http://192.168.122.1:8080/contentstransfer/org/index%3A%2F%2F1000%2F00000100-default%2F00000047-00000C3D_71_256_1000

Related

How to send value which contains backward slash, dynamically in postman request body?

I am using Postman for testing POST API.
Purpose of API : The API should download some data at given "path".
Case : 1
When I give hard-coded path in request body-
{
"downloadPath": "D:\\folderName",
"objectID": "1234"
}
I get expected response in this case.
Case : 2
I want to send this path and ID dynamically.
Now the Request Body looks like-
{
"downloadPath": "{{path}}",
"objectID": "{{id}}"
}
It reads the values from JSON file which looks like-
[
{
"path":"D:\\folderName1",
"id":"1234"
},
{
"path":"D:\\folderName2",
"id":"5678"
}
]
It does not give expected response.
Note: When I tried hard-coded path with dynamic id, it works fine
What could be the reason?
Thanks in advance.

opentok - archiving to AWS folder fails

I simply call the startArchive / stopArchive methods opentok.
Then I check the AWS folder to see if the files are successfully recorded.
However, for some cases, the JSON created for the archive is not complete, and there is no video file saved at all.
Any idea how to pinpoint the reason for this issue?
Example JSON - a successful one;
"createdAt" : 1494502861651,
"files" : [
{
"connectionData" : "",
"filename" : "xxxx.webm",
"size" : 204288,
"startTimeOffset" : 571,
"stopTimeOffset" : 15469,
"streamId" : "xxxxx-5944-43cd-85ff-1904a54e04ca",
"videoType" : "camera"
}
],
"id" : "1xxxx1-3c75-48dc-b2e5-19714b911967",
"name" : "Shamaleyte",
"sessionId" : "2_MX40NTYwMjxxxx-
MTQ5MzkwNDMzNTg3NX5XUWRxxxxBVjYrUE5DTUZwUzhCNnFwdi9-fg"
}
Example JSON - a broken one; as you can observe, there is no filename, size, and stopTimeOffset parameters in this JSON.
"createdAt" : 1494502861651,
"files" : [
{
"connectionData" : "",
"startTimeOffset" : 571,
"streamId" : "xxxxx-5944-43cd-85ff-1904a54e04ca",
"videoType" : "camera"
}
],
"id" : "1xxxx1-3c75-48dc-b2e5-19714b911967",
"name" : "Shamaleyte",
"sessionId" : "2_MX40NTYwMjxxxx-
MTQ5MzkwNDMzNTg3NX5XUWRxxxxBVjYrUE5DTUZwUzhCNnFwdi9-fg"
}
So it seems like that the stopArchiving somehow fails to upload the webm file because of a reason. How could I debug it?
PS : I checked the opentok UI in order to see the status of the archiving and it says "uploaded" but the weird thing is that the details are as the following;
Length Size
00:00:00 0.00MB
Why so?
This looks identical to a known issue in Opentok platform that should be fixed on our next release, currently just about to be deployed. This should not reproduce once TB next deployment is complete.

skype for business conversation API

We are trying to use UCWA 2.0 API for integrating Skype for Business Online. Using MS developer account(Azure AD tenant) with free trial.
After home pool server discovery when we create the application resource we get limited resources links in the response of POST
UCWA 2.0 API documentation mentions many resources and links for all of them are not provided in the response of above POST.
Quesiton -1 : Are all UCWA 2.0 REST resources available for use with Skype for Busines Online? If not then which are not exposed and when they will be available?
Question 2:
We are struggling specially with conversationlogtranscript. Objective is to get the chat transcript of chat conversation in a meeting .
What we have tried is here:
Hit to POST https://webpoolmaain102.infra.lync.com/ucwa/oauth/v1/applications/10241512914/communication/makeMeAvailable ( to add modalities like messaging)
with body
{
"audioPreference" : "PhoneAudio",
"phoneNumber" : "4255552222",
"signInAs" : "BeRightBack",
"supportedMessageFormats" : [
"Plain",
"Html"
],
"supportedModalities" : [
"PhoneAudio",
"Messaging"
]
}
returns 204 No Content
Hit to PUT https ://webpoolmaain102.infra.lync.com/ucwa/oauth/v1/applications/10241512914/communication, (where we are trying to enable a specific parameter "conversationHistory")
returns :
428 Precondition Required with If-Match header as 3fc81bb8-98f5-48b3-8981-d2fbd05305f. or 1529525322 (communications etag value)
Response body in both base : {
"code": "PreconditionRequired",
"message": "Your request couldn't be completed."
}
here body of this PUT as below:
{
"simultaneousRingNumberMatch" : "Disabled",
"videoBasedScreenSharing" : "Disabled",
"rel" : "communication",
"audioPreference" : "PhoneAudio",
"conversationHistory" : "Enabled",
"lisLocation" : "samplevalue",
"lisQueryResult" : "Succeeded",
"phoneNumber" : "tel : +14255524222",
"publishEndpointLocation" : true,
"supportedMessageFormats" : [
"Plain",
"Html"
],
"supportedModalities" : [
"PhoneAudio",
"Messaging"
]
}
Header of this PUT is as below:
If-Match:3fc81bb8-98f5-48b3-8981-d2fbd05305f
Authorization:Bearer
Accept:application/json
Content-Type:application/json
Host:webpoolmaain102.infra.lync.com
Here we have tried "If-Match" header with both : (1) "3fc81bb8-98f5-48b3-8981-d2fbd05305fc": (this value comes with text "please pass this in a PUT request") and (2) "etag": "1529525322" . Both from "communication" section inside embedded of the application resources.
So both ways to enable conversationHistory settings through communication resources is giving 428 issue which shoudl not come as we are passing "If-Match" header already.
Can you pls suggest if we are doing something wrong here and how can we get "conversationLogTranscript" of a user's meetings
Regards,
Sourabh

google-oauth calendar returns 401 error

I tried the calendar-appengine-sample on google calendar api java sample and when I used the client_secrets.json for running in localhost it always give me back my calendar list, but when I use the client_secrets.json to be run on google app engine, it give me following error message :
ERROR: 401
{
"code" : 401,
"errors" : [ {
"domain" : "global",
"location" : "Authorization",
"locationType" : "header",
"message" : "Invalid Credentials",
"reason" : "authError"
} ],
"message" : "Invalid Credentials"
}
Before it work with the same client_secrets.json, but suddenly it doesn't work. Would anyone be so kindly tell me how to fix this problem?
thanks.
I had asked this some time back (assuming your using version 3 of the API), and here is a potential answer.
If you get a 403 error, which I did after fixing this then try this.

HTTP Adapter Error "Runtime: Failed to parse JSON string"

I am using IBM Worklight Studio, and trying to create HTTP Adapter which retrieve JSON object from external http server.
When I just access target http server with HTTP Get access(with browser, for example), I know their response is like following array style JSON format:
[
{ "xxx":"aaa", "yyy":"bbb", ... },
{ "xxx":"ccc", "yyy":"ddd", ... },
:
{ "xxx":"eee", "yyy":"fff", ... }
]
And I had created HTTP Adapter which would retrieve above information
var input = {
method : 'get',
returnedContentType : 'json',
path : path
};
return WL.Server.invokeHttp(input);
Now I tried to invoke this adapter with "Run As -> Invoke Worklight Procedure", then I got this error message:
{
"errors": [
"Runtime: Failed to parse JSON string\n\n[\n {\n
(raw JSON data) } ],
"info": [],
"isSuccessful": false,
"warnings": []
}
And in my log console, worklight says following error messages:
FWLSE0101E: Caused by: java.io.IOException: Expecting '{' on line 2, column 2 instead, obtained token: 'Token: ['
From above information, it seems that worklight would expect that returned JSON object need to start with "{", not "[".
Is this my guess right? Are there any workaround for this?
Thanks for advance.
Worklight knows how to handle JSON objects that start with [ (JSON arrays). In such case Worklight will return the response as:
{ "array" : [*the json array*]}
Looking at the code of the HTTP Adapter, I see that there is a bug with parsing JSON arrays that do not start with [.
I do not see a workaround for this problem, except changing the response returned from the http server.
I opened an internal bug about this, thank you for helping us find this bug.
You can change returnedContentType to "plain", this will make WL server return content as a big string and not attempt to parse it.
Then in your adapter you can use var obj = JSON.parse(response.text)