These are chat archives for ushahidi/Community

14th
Oct 2015
Ushbot
@ushbot
Oct 14 2015 10:18
[Juliana Rotich, Ushahidi] quick question, is info@ushahidi.com still the email for folks to send feedback/questions about any of our products?
[Jess Shorland, Ushahidi] @JulianaRotich yep! they can send to that email, directly within product through the feedback box, or create a ticket on github -- whichever works for them :-)
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 11:05
M
Ushbot
@ushbot
Oct 14 2015 11:06
[Juliana Rotich, Ushahidi] thank you Jess!
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 11:17
@ushbot @Robbie: Thanks for the reply
@ushbot Robbie: Where can I get the access token? What is the endpoint? I’m totally noob so...
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 11:56
Now Im looking for SwiftRiver API authentication
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 12:04
Is it correct that I must go http://swiftapp.com/apps to get the client_id and client_secret?
The problem is the site is not working
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 12:13
Well it's really hard for me to use v3's REST API...
What I know is that I need client_id and client_secret to request for token, but I don't know how to get those two
or I'm completely wrong maybe :(
https://jkr-ushahidi.herokuapp.com -> this is my deployment
Ushbot
@ushbot
Oct 14 2015 13:08
[Jess Shorland, Ushahidi] @Jason any idea on how to help @kyoungrok0517 ^^?
Ushbot
@ushbot
Oct 14 2015 13:18
[Jason Mule, Ushahidi] @kyoungrok0517 You can use the ushahidiui as a client_id to test
Ushbot
@ushbot
Oct 14 2015 13:32
[kyoungrok0517] @Jason Hi Jason
[kyoungrok0517] May I ask some questions regarding the use of v3 API??
[kyoungrok0517] I'm preparing the demo for my project, and knowing how to use API is time-critical
[Jason Mule, Ushahidi] Sure. Have you also tried to install locally to look at the code?
[kyoungrok0517] I deployed on heroku
[kyoungrok0517] 1) to what url should I feed client_id=ushahidiui?
Ushbot
@ushbot
Oct 14 2015 13:39
[Jason Mule, Ushahidi] not quite so you need to create a payload with the client_credentials grant type, client_id and secret with scopes and then post that to /oauth/token to get an access token.
[Jason Mule, Ushahidi] makes sense?
[Jason Mule, Ushahidi] you can use the defaults from an install to get up and running for starters...
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 13:43
POST to /oauth/token with which params?
use defaults? what defaults?
Ushbot
@ushbot
Oct 14 2015 13:44
[Jason Mule, Ushahidi] one minute.
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 13:44
I think I'm not well versed with this REST things
Thanks
Ushbot
@ushbot
Oct 14 2015 13:45
[Jason Mule, Ushahidi] have you used oauth2 before?
[Jason Mule, Ushahidi] rather oauth 2.0
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 13:46
I used it when using Google service
usually I could retrieve client_id from GUI
I think this also should work similar, right?
If I have the access_token, then I append ?access_token=<token>
to access the protected resources
Correct so far?
Ushbot
@ushbot
Oct 14 2015 13:56
[Jason Mule, Ushahidi] we can actually put the access_token in the header
[Jason Mule, Ushahidi] have you downloaded the V3 client?
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 13:56
Yes
Ushbot
@ushbot
Oct 14 2015 13:56
[Jason Mule, Ushahidi] ok, good.
[Jason Mule, Ushahidi] take a look at app/common/configs/authentication-interceptor.js
[Jason Mule, Ushahidi] you can see how the exchange happens to get an access_token
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 13:58
OK I'll look into it
Ushbot
@ushbot
Oct 14 2015 13:59
[Jason Mule, Ushahidi] let me know if you need anything clarified on that file.
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 14:01
 payload = {
                grant_type: 'client_credentials',
                client_id: CONST.OAUTH_CLIENT_ID,
                client_secret: CONST.OAUTH_CLIENT_SECRET,
                scope: CONST.CLAIMED_ANONYMOUS_SCOPES.join(' ')
            },
Ushbot
@ushbot
Oct 14 2015 14:01
[Jason Mule, Ushahidi] yup
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 14:02
So I need client_id, client_secret, and scope to get the access_token
hmm.... where's CONST declaration?
What I'm still curious is how could I get client_id and secret
the exact values required to get the token
Ushbot
@ushbot
Oct 14 2015 14:03
[Jason Mule, Ushahidi] in app/app.js
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 14:03
should I generate using another API? or
ok
.constant('CONST', {
        BACKEND_URL         : backendUrl,
        API_URL             : apiUrl,
        DEFAULT_LOCALE      : 'en_US',
        OAUTH_CLIENT_ID     : 'ushahidiui',
        OAUTH_CLIENT_SECRET : '35e7f0bca957836d05ca0492211b0ac707671261',
        CLAIMED_ANONYMOUS_SCOPES : claimedAnonymousScopes,
        CLAIMED_USER_SCOPES : claimedAnonymousScopes.concat('dataproviders')
    })
could I use the values as it is?
of course I'll try right away
Kyoungrok Jang
@kyoungrok0517
Oct 14 2015 14:09
Now I figured out
Thank you very much!
Ushbot
@ushbot
Oct 14 2015 14:10
[Jason Mule, Ushahidi] cool!
Ushbot
@ushbot
Oct 14 2015 14:56
[Brad Anthony] @Jason what would I need for assets set up, to show the hackathon team this weekend to build a evidence collection app?
[Jason Mule, Ushahidi] Hey Brad. What do you mean by assets set up?
[Jason Mule, Ushahidi] If you mean the API. Yes, you definitely need to have this running
[Brad Anthony] Wondering if I would need a server set up for the hackathon team to work on an app to connect to ushi or would they just need to see the code that I can get from git hub?
[Jason Mule, Ushahidi] I wouldn't recommend using the Ushi API just yet for the hackathon because documentation for that is not up to date
[Jason Mule, Ushahidi] I would recommend hacking on the V3 API source and V3 JS client
Ushbot
@ushbot
Oct 14 2015 15:02
[Brad Anthony] This hackathon is dedicated to building on meteorJS, can we do that and still be compatible with ushi code?
[Jason Mule, Ushahidi] You could look at the JS client to understand how the API is used before then?
Ushbot
@ushbot
Oct 14 2015 15:11
[Jason Mule, Ushahidi] the idea would be to understand how the API is called and if that works, you could set up a server running the API and develop a meteorJS client that uses the API. Does that sound doable?
[Brad Anthony] I'm not sure; I haven't been able to set up V3 at all so it doesn't seem doable for me.
[Jason Mule, Ushahidi] Can we help by walking you through the process -- assuming that you have server ready?
Ushbot
@ushbot
Oct 14 2015 15:22
[Brad Anthony] Sure, I assume it's ready, I'm running V2 on it now
Ushbot
@ushbot
Oct 14 2015 15:32
[Jason Mule, Ushahidi] Is it a shared host?
[Brad Anthony] Shared yes, but they've given me a dedicated ip with shell access
Ushbot
@ushbot
Oct 14 2015 16:04
[Jason Mule, Ushahidi] sorry, was away. Could we quickly check what PHP version you are running?
[Jason Mule, Ushahidi] and do you also have full access to MySQL?
Ushbot
@ushbot
Oct 14 2015 16:12
[Brad Anthony] Apache 2.2.26
PHP 5.4.45
MySQL 5.5.45
OS Linux
Ushbot
@ushbot
Oct 14 2015 16:21
[Jason Mule, Ushahidi] the other thing to check is whether you have root :-)
[Brad Anthony] Yes, I do :-D
[Jason Mule, Ushahidi] cool. Could we connect in 2 hours and try to install? I wonder if there is a way to do this on one-to-one chat
[Brad Anthony] Skype?
[Jason Mule, Ushahidi] yup
[Jason Mule, Ushahidi] you can add me as jason.mule
[Brad Anthony] Ok, let's use skype so we don't bother everyone here. Adding you now.
[Brad Anthony] Are you in Kenya? There's a lot of JM's on skype apparently :-D
[Jason Mule, Ushahidi] yes, Kenya
[Brad Anthony] cool
Ushbot
@ushbot
Oct 14 2015 17:59
[Charlie Harding, Ushahidi] What services do we run our backend on?
Ushbot
@ushbot
Oct 14 2015 18:10
[Charlie Harding, Ushahidi] MySQL database on Rackspace/
[Charlie Harding, Ushahidi] ?
[Nathaniel Manning, Ushahidi] i am pretty sure that is right