1

I follow the instruction to upload a photo link.
I get the photoId after call.
But I can not get the image by call :

curl --request GET \
    --url 'streetviewpublish.googleapis.com/v1/photos?key=YOUR_API_KEY' \
    --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

or call:

curl --request GET \
    --url 'streetviewpublish.googleapis.com/v1/photo/PHOTO_ID?key=YOUR_API_KEY' \
    --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

I see the tutorial say that if you get the photoId means the upload is the success. How can I make sure my photo is upload success?

update: Base on Mr.Rebot's opinion, I add --verbose to see the response detail. But I can not found any error from response. I guess the root cause may be happen on Upload the photo bytes to the Upload URL. I check the response detail. It not show the message like "* upload completely sent off: 632 out of 632 bytes" in Upload the metadata of the photo response. But I don't know how to solve it.

the Upload the photo bytes to the Upload URL response is show below:

*   Trying 216.58.200.42...
* TCP_NODELAY set
* Connected to streetviewpublish.googleapis.com (216.58.200.42) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.googleapis.com
* Server certificate: Google Internet Authority G2
* Server certificate: GeoTrust Global CA
> POST /media/user/114009162009986408485/photo/3946916238102603576 HTTP/1.1
> Host: streetviewpublish.googleapis.com
> User-Agent: curl/7.51.0
> Accept: */*
> Authorization: Bearer ya29.GlvKBHgR75-11mkyh-7Yy0YHSnY2at7ceBKkmcz6Kmt0axDqRD7iTfqp8_nfBZgQrU25V77WKk3gCBZ6w6ce9TBz26mLusLzZqjX7qUGi306Z_PhkPTSqfXZwte2
> Content-Length: 2684889
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< X-GUploader-UploadID: AEnB2Uq1RvuwmbMZizf-MLlPcB8hJC2NBgpaEMR-K_AomU7nIQ7DTkv94Ekij3_zPNyPK7tTypkYywHualC_EnvzCoM2OuosuckDFF8OtoLT97CecFwnYk4
< Content-Length: 0
< Date: Mon, 18 Sep 2017 06:01:25 GMT
< Server: UploadServer
< Content-Type: text/html; charset=UTF-8
< Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35"
< 
* Curl_http_done: called premature == 0
* Connection #0 to host streetviewpublish.googleapis.com left intact

the Upload the metadata of the photo response is show below:

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 216.58.200.234...
* TCP_NODELAY set
* Connected to streetviewpublish.googleapis.com (216.58.200.234) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.googleapis.com
* Server certificate: Google Internet Authority G2
* Server certificate: GeoTrust Global CA
> POST /v1/photo?key=AIzaSyBINbdfV0eqE2fdc_ywJzL-oCa7fs_qNrQ HTTP/1.1
> Host: streetviewpublish.googleapis.com
> User-Agent: curl/7.51.0
> Accept: */*
> Authorization: Bearer ya29.GlvKBHgR75-11mkyh-7Yy0YHSnY2at7ceBKkmcz6Kmt0axDqRD7iTfqp8_nfBZgQrU25V77WKk3gCBZ6w6ce9TBz26mLusLzZqjX7qUGi306Z_PhkPTSqfXZwte2
> Content-Type: application/json
> Content-Length: 632
> 
* upload completely sent off: 632 out of 632 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
< Vary: X-Origin
< Vary: Referer
< Date: Mon, 18 Sep 2017 05:47:24 GMT
< Server: ESF
< Cache-Control: private
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35"
< Accept-Ranges: none
< Vary: Origin,Accept-Encoding
< Transfer-Encoding: chunked
< 
{
  "photoId": {
    "id": "CAoSLEFGMVFpcE9Zc0I4U25pWkcwaUFRWk11ZXZ3d3VzVkRaUTFxZlIyWks5VnE2"
  }
}
* Curl_http_done: called premature == 0
* Connection #0 to host streetviewpublish.googleapis.com left intact
Szu Wei Chen
  • 103
  • 5

2 Answers2

1

Finally I found the root cause problem. I miss some XMP meta on my photo. Google not check and response the error for wrong XMP meta photo. So make sure your photo have correct XMP meta is the only way to fix it.

Szu Wei Chen
  • 103
  • 5
0

You can try adding --verbose at the end of your request when calling Step 2 of Uploading a photo (if you are using curl). Also you can also check the response code, if it is 200 then its ok. Lastly, make sure that you are uploading a proper 360 image. Follow this comment, that talks about photosphere metadata and exiftool

Mr.Rebot
  • 6,703
  • 2
  • 16
  • 91
  • Thanks for your reply. So I can not get the uploaded image if my image not add proper XMP?? The response I update on my topic and is show 200 ok. But I not add XMP on metadata following the https://developers.google.com/streetview/spherical-metadata. I'll try to add proper XMP and see the result. – Szu Wei Chen Sep 18 '17 at 03:21
  • it's weird that after I check my photo. The XMP information is correct following the XMP guide (https://developers.google.com/streetview/spherical-metadata). I use Nikon theta-s to shoot the panorama. It's XMP is follow the guide. I don't know why I can not use api to get my uploaded image info. – Szu Wei Chen Sep 18 '17 at 03:52