HTTP Request

Development related questions, API questions and documentation, questions about integration, API/custom behaviour suggestions, how-to documents and all the nitty gritty.

AuthorPost

HTTP Request

nloui
 
Posts: 10
Joined: Mon Jan 12, 2015 10:04 pm

Post Posted » Tue Jan 13, 2015 6:03 pm

Hi all,

New to the Ubi and am trying to navigate the waters. I'm trying to setup a custom HTTP request that responds based on an HTTP trigger. When I click the "test" button, an alert box pops up with nothing in it. I'm curious if anyone has stumbled into this issue?

Image

You'll see that the goal is just to respond with the weather from the openweathermap API.

Best,
Nick

Re: HTTP Request

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Tue Jan 13, 2015 6:08 pm

@Nick! Awesome that you're testing this out. The test box pings that address and is the response our server sees. If there's nothing in the box, we won't see a response passed to the Ubi. Are you able to get a response from Postman or just pinging that address?

Re: HTTP Request

nloui
 
Posts: 10
Joined: Mon Jan 12, 2015 10:04 pm

Post Posted » Tue Jan 13, 2015 6:10 pm

Leor wrote:@Nick! Awesome that you're testing this out. The test box pings that address and is the response our server sees. If there's nothing in the box, we won't see a response passed to the Ubi. Are you able to get a response from Postman or just pinging that address?


Yes, hopefully this is a helpful "lesson" for others to use as well!

I am able to get a response in-browser. FWIW, this is the clickable version of that server url: http://api.openweathermap.org/data/2.5/ ... s=imperial

Re: HTTP Request

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Wed Jan 14, 2015 12:57 am

Using that link, I could get a response when testing:
https://www.dropbox.com/s/qwo6w2i8shgi7 ... 5.png?dl=0

Maybe it was a temporary issue?

Re: HTTP Request

nloui
 
Posts: 10
Joined: Mon Jan 12, 2015 10:04 pm

Post Posted » Wed Jan 14, 2015 1:21 am

Hmmm

here's what I'm seeing... unfortunately it still looks like it isn't working on my end.

I'm using an HTTP request trigger, which is the only thing I can think of as the difference.

I can confirm that when using the "HTTP Request" trigger, it doesn't work but when using the "utterance" trigger, it does work.

This is what the HTTP response to https://portal.theubi.com/rule/testAction looks like :

{"id":"0","result":"OK","message":"","data":null}

And, if it helps for reference: View My Video

Re: HTTP Request

nloui
 
Posts: 10
Joined: Mon Jan 12, 2015 10:04 pm

Post Posted » Thu Jan 15, 2015 3:32 pm

So interestingly also, switching it from a request from the Portal to coming from my specific Ubi solved the issue.

Re: HTTP Request

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Thu Jan 15, 2015 6:43 pm

That's interesting. It could be time and which instance it's coming from on our server. For local, it'll be coming from your home IP - could be that's causing it to work.

I'm speculating now because I wasn't able to replicate.

Re: HTTP Request

nloui
 
Posts: 10
Joined: Mon Jan 12, 2015 10:04 pm

Post Posted » Thu Jan 15, 2015 6:46 pm

Hmm ok. Could be something worth looking into. I also noticed a weird issue where when parsing JSON responses, string was read back fine but integers weren't being spoken.

Re: HTTP Request

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Thu Jan 15, 2015 11:21 pm

Can you email me at leor@ with your Portal email? I can look up the local APK version.

If it's still a newer one, will ticket this to see if we need to make a change to the next release.

Thanks so much!

Re: HTTP Request

pieter
 
Posts: 20
Joined: Wed Dec 03, 2014 12:54 pm

Post Posted » Thu Feb 05, 2015 10:50 am

not working for locally, the text for 'extract' is not spoken by Ubi :(
what im i doing wrong? this should work
please help ubi guys!

ubi1.jpg
You do not have the required permissions to view the files attached to this post.

Re: HTTP Request

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Thu Feb 05, 2015 11:49 pm

@pieter, you'll need to use the "Subsequent Action" button to get this to run correctly. Let me know how that goes!

Re: HTTP Request

pieter
 
Posts: 20
Joined: Wed Dec 03, 2014 12:54 pm

Post Posted » Fri Feb 06, 2015 4:44 am

HI Leor,
can you post a screenshot of the right setting please?
i use a "Subsequent Action" for this, see my screenshot
im clicking like hell in the gui :) but dont understand what you mean
i only have these options (see screenshot)

ubi2.jpg

thanks!
You do not have the required permissions to view the files attached to this post.

Re: HTTP Request

LeorUser avatar
Admin/Team Ubi
 
Posts: 452
Joined: Sun Jun 22, 2014 7:18 pm
Location: Toronto, Ontario

Post Posted » Fri Feb 06, 2015 6:26 pm

Yeah - I see where it can improved. Select from the pulldown menu on Subsequent Action "Voice Announcement" - that should do it.

Let me know!

Re: HTTP Request

pieter
 
Posts: 20
Joined: Wed Dec 03, 2014 12:54 pm

Post Posted » Fri Feb 06, 2015 7:14 pm

i did not see that option :)
working now
thanks!

but the server is terrible slow for days and days now
this is very bad :cry:

Re: HTTP Request

pieter
 
Posts: 20
Joined: Wed Dec 03, 2014 12:54 pm

Post Posted » Sun Feb 08, 2015 8:02 am

normal ubi operations like "play Michael jackson" are working
but this is taking more then 30 seconds to perform so veryyyyy slow
looks like the {$.extract) of the json to speech is causing this, deleting this action makes it much faster

can you please explain and have an alternative?