GroveStreams
markbranly private msg quote post Address this user
Hi,

I am trying to perform a simple read operation using the advanced API and am running into an error.

My request:
https://grovestreams.com/api/component/{component_uid}?api_key={api_key_here}


Returns this:
{"errCode":"UNKNOWN_EXCEPTION","success":false}


I pulled the UID from the resulting XHR url when I pull up the component I want.

https://grovestreams.com/api/component/{component_uid}?detailAmount=forQuickView&numIntvls=0&org={org_uid}


The error occurs whether I am logged into Grovestreams or not.

Any suggestions?
Post 1 IP   flag post
MikeMills private msg quote post Address this user
Hi markbranly.

You are replacing the variables component_uid, api_key_here in this URL with the actual UUIDs - right?
https://grovestreams.com/api/component/{component_uid}?api_key={api_key_here}

org={org_uid} can be left off the url if an api_key is used.

Try entering the org that the api_key belongs to and check for any system notifications. Paste it here if there is one. The stack trace in the notification will give us a clue.
Post 2 IP   flag post
markbranly private msg quote post Address this user
Thanks for the quick response. I should have been more clear. I removed the actual values as not to expose them.

That second url is what the Grovestreams UI uses when I bring up the component in the Observation Studio. If I paste that URL in a browser window where I am logged in, it will output the JSON. I was just using that as a baseline.

Below is the system notification with private info redacted. Would it be helpful if I PM'd you the unmodified notification?


-----


API Exception Details:
Resource Path:
/api/component/[redacted]
Resource Method: GET
Client Address:
76.182.1.23
Client Attributes:
{org.restlet.http.version=1.1, org.restlet.http.headers=[[host: grovestreams.com], [connection: keep-alive], [user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36], [accept: */*], [Accept-Encoding: gzip,deflate,sdch], [Accept-Language: en-US,en;q=0.8], [cookie: usrEmail=[redacted]; guest=false; login_Id=[redacted]; pass=[redacted]; __atuvc=1%7C13; session=[redacted]; usrId=[redacted]; usrName=Mark%20Branly], [content-length: 0]], org.restlet.startTime=1395853775137, compUid=[redacted]}

Exception:

null


You are allowed one API exception notification per hour per authenticated session. This was the latest exception for this hour.
Post 3 IP   flag post
MikeMills private msg quote post Address this user
That wasn't a very helpful trace. The error must happen right away when we're parsing url parameters. Looks like we need to do a better job with parsing errors in that particular call.

The first URL in your initial post will return the component definition. The second one returns the definition along with the last numIntvls (number of samples) for each stream.

I assume you'd like to get the first url working.

I opened Chrome, hit F12, selected Network, clicked filter and selected XHR. I then right clicked on a component and chose Edit Component. Here's the GET url that showed up in Chrome for my component:
https://grovestreams.com/api/component/0e95694d-91ce-3034-92bf-4e724dd18882?&org=00000000-0000-0000-0000-000000000001&_dc=1395858541541

That's the URL the browser uses. If you want to make an API call, not from java script in the browser, then it should look something like this:
https://grovestreams.com/api/component/0e95694d-91ce-3034-92bf-4e724dd18882?api_key=put_your_api_key_uid_here
(I opened a new browser without logging into GS, and pasted that URL with the api_key set into the browser and it worked)

That url looks exactly like yours: https://grovestreams.com/api/component/{component_uid}?api_key={api_key_here}

Your call made it to our server logic since a system notification was generated. Ensure:
1) You have the correct component uid
2) You have the correct api_key. Make sure it is the secret key, not the uid of the ApiKey definition.
3) Ensure that you copy and pasted them correctly - that you didn't leave off one or more characters.
4) Ensure the api key allows for component/*/ GET
(you can replace the * with the uid of your specific component if you wish).
Post 4 IP   flag post
MikeMills private msg quote post Address this user
I just reproduced your error by using an API key that only gave rights to the component feed, not the component definition. I'm guessing that's your issue. We'll dig into why the correct error message didn't appear.
Post 5 IP   flag post
PaladinEngineering private msg quote post Address this user
Which checkbox covers the component definition?
I've set up the key to allow GET for
component/*/feed
component
component_template
Post 6 IP   flag post
MikeMills private msg quote post Address this user
"component" Should allow for component GETs. "component/*" should work too.

Paladin, are you getting an error too? we're still investigating the above error/exception.
Post 7 IP   flag post
PaladinEngineering private msg quote post Address this user
I'm the other half of the same error. markbranly and I are working on the same project. I'm responsible for the grovestreas side, he's setting up an application that pulls data from grovestreams
Post 8 IP   flag post
MikeMills private msg quote post Address this user
Yes, this should work.
component
component_template
component/*/feed

But there's a bug preventing it from working. We've put together a patch and are testing it. I'll post here once the patch is in place - Hopefully later today.
Post 9 IP   flag post
MikeMills private msg quote post Address this user
The patch has been applied.
Post 10 IP   flag post
markbranly private msg quote post Address this user
Working! Thanks, Mike.
Post 11 IP   flag post
2837 11 11
Log in or sign up to compose a reply.
destitute