Search code examples
androidbeaconeddystonegoogle-beacon-platform

Retrieving beacon attachments proximity beacon api


Currently I have registered beacons to the Google Proximity Beacon API. They're Eddystone beacons. I can also retrieve the beacon's data and add attachment (I think). The problem I have is retrieving those attachments.

I used the following website to retrieve the attachments, but I get a 404 error in return. https://labs.ribot.co.uk/exploring-google-eddystone-with-the-proximity-beacon-api-bc9256c97e05#.rndagn22e

<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/v1beta/beaconName/attachments/</code> was not found on this server.  
<ins>That’s all we know.</ins>

I used a GET method to retrieve the data. My application sends the request with a token using a Volley JsonObjectRequest. This is the URL I am using:

GET https://proximitybeacon.googleapis.com/v1beta1/beaconName/attachments

If I use the GET method to retrieve the beacons I do also not recieve the attachments (I can't find it anywhere if it should return the attachments as well).

Is it possible that I use the wrong URL? Has anyone else come across the same problem?

EDIT: I updated my url with the query parameter required:

https://proximitybeacon.googleapis.com/v1beta/beaconName/attachments?namespacedType=*/*

In the request headers I put the token I retrieved from a previous request (oAuth2.0). There's no API key involved here. Every other method for updating, registering and retrieving beacons work, except for retrieving attachments.

SOLVED There was a 1 missing in the URL

https://proximitybeacon.googleapis.com/v1beta1/beaconName/attachments?namespacedType=*/*

Solution

  • https://proximitybeacon.googleapis.com/v1beta/beaconName/attachments?namespacedType=*/*
    

    The above URL is missing a 1 after v1beta, it's supposed to be v1beta1 as written in de URL below.

    https://proximitybeacon.googleapis.com/v1beta1/beaconName/attachments?namespacedType=*/*