These are chat archives for ushahidi/Community

23rd
Oct 2016
Nesp
@Nesp
Oct 23 2016 15:08
Dear Sirs,
I am facing some problems with collecting tweets with a specific hashtag and mapping them in a Ushahidi V3 deployment. I face the same problem with Crowdmap Classic. Then, I realized that when I create the twitter application and click on Test OAuth, the access results denied.
I did add and verified my phone number in my twitter account. Nevertheless, my access is still dedined. I guess there is some problem with my twitter account. Could you help me please?
Nesp
@Nesp
Oct 23 2016 15:49
thank you very much for your time! :-)
Ushbot
@ushbot
Oct 23 2016 15:52
[Angela Oduor Lungati, Ushahidi] Hi @nesp. Have you followed instructions on how to set up twitter here? https://www.ushahidi.com/support/data-sources. Have a look then let me know? We’re here to help
Nesp
@Nesp
Oct 23 2016 16:02
Dear @ushbot, thank you very much. I did check the instructions you sent and went through the procedure once more. Though I still don't see tweets streaming in the map. As a reasearch term I used "vote" which is always active in Twitter.
Ushbot
@ushbot
Oct 23 2016 19:28
[Robbie Mackay, Ushahidi] @kyoungrok0517 its really only necessary to create those bundles for users to download. If you’re deploying customised code you can either checkout the git repositories on the server, or copy the files over FTP.
For platform client you just need to copy the files generated in server/www after running gulp build
Zeeshan Shah
@Zkage
Oct 23 2016 19:38
Hi again, I am trying to get the Oauth token using the http://safr.southeastasia.cloudapp.azure.com/platform/api/v3/oauth/token link
can smeone guide me how to create the API request? I have been looking at the documentation
Ushbot
@ushbot
Oct 23 2016 19:48
[Robbie Mackay, Ushahidi] @Zkage do you want an anonymous token? or do you need to authenticate as a user?
Zeeshan Shah
@Zkage
Oct 23 2016 19:48
hey @ushbot as an admin user
Ushbot
@ushbot
Oct 23 2016 19:49
[Robbie Mackay, Ushahidi] There are some semi-official docs here: http://github.ushahidi.org/platform/docs/api/index.html#authorization-with-oauth-2 that should get you started
Zeeshan Shah
@Zkage
Oct 23 2016 19:49
blob
Ushbot
@ushbot
Oct 23 2016 19:50
[Robbie Mackay, Ushahidi] You need to use the password grant (sometimes call "resource owner”)
Zeeshan Shah
@Zkage
Oct 23 2016 19:50
what about the URL i should be using? in the demo it mentions http://demo.api.ushahidi.io/api/v3/oauth/token
Ushbot
@ushbot
Oct 23 2016 19:50
[Robbie Mackay, Ushahidi] client credentials will only get you an anonymous token
Ushbot
@ushbot
Oct 23 2016 19:52
[Robbie Mackay, Ushahidi] probably.. but looking at `http://safr.southeastasia.cloudapp.azure.com/platform/` I don’t think your API is set up correctly
Zeeshan Shah
@Zkage
Oct 23 2016 19:53
i followed the pre built/zipped file method and the website all works properly at http://safr.southeastasia.cloudapp.azure.com/
Ushbot
@ushbot
Oct 23 2016 19:54
[Robbie Mackay, Ushahidi] hrm ok. What is your backendUrl set to?
[Robbie Mackay, Ushahidi] Ok weird. Its only the top level URL thats broken. Rest of the API works beautifully.
Zeeshan Shah
@Zkage
Oct 23 2016 19:56
how do i fix the top level url?
Ushbot
@ushbot
Oct 23 2016 19:56
[Robbie Mackay, Ushahidi] no idea. it doesn’t actually matter
[Robbie Mackay, Ushahidi] you’ll need a client id and secret - thats not the same thing as user + password
Zeeshan Shah
@Zkage
Oct 23 2016 19:56
right
Ushbot
@ushbot
Oct 23 2016 19:57
[Robbie Mackay, Ushahidi] for client you can use: ushahidiui
secret: 35e7f0bca957836d05ca0492211b0ac707671261
[Robbie Mackay, Ushahidi] they’re the same on most deployments, since they don’t get you anything other than anon access without a user too
Zeeshan Shah
@Zkage
Oct 23 2016 19:58
i am using postman; which API tool do you use to test
Ushbot
@ushbot
Oct 23 2016 19:58
[Robbie Mackay, Ushahidi] so the payload you send should look like
\` { "grant\_type": "password", "client\_id": “ushahidiui", "client\_secret": "35e7f0bca957836d05ca0492211b0ac707671261", "username": "[someuser@domain.com](mailto:someuser@domain.com)", "password": "somepassword", "scope": "post,user” }`
You might need to add further scopes depending on what you’re doing next.
[Robbie Mackay, Ushahidi] I use postman occasionally, but usually I’m working directly in JS sorry.
Zeeshan Shah
@Zkage
Oct 23 2016 19:59
np
this is helpful;
Ushbot
@ushbot
Oct 23 2016 19:59
[Robbie Mackay, Ushahidi] What other options does Postman have in “Grant Type"
Zeeshan Shah
@Zkage
Oct 23 2016 20:00
authorization code and client credentials
it has an Auth URL and an access token URL
Ushbot
@ushbot
Oct 23 2016 20:03
[Robbie Mackay, Ushahidi] Ah. You’ll have to do it manually - neither of those will work if you want an admin token
Zeeshan Shah
@Zkage
Oct 23 2016 20:03
yeah putting it in the boddy
Ushbot
@ushbot
Oct 23 2016 20:03
[Robbie Mackay, Ushahidi] Full list of scopes is this: posts,media,forms,api,tags,savedsearches,sets,users,stats,layers,config,messages,notifications,contacts,roles,permissions,csv
if you use that it’ll get you a token with access to everything
Zeeshan Shah
@Zkage
Oct 23 2016 20:04
got it, i want to pull the recent posts from the api and put it into my ML library
im using a lamp box hosted in azure cloud
so trying to make it a real time feed using their streaming
are there any best practices for setting up SMS into ushahidi? been working on distributing to rural population for input
hmm trying this directly into the body and getting a 404
Ushbot
@ushbot
Oct 23 2016 20:06
[Robbie Mackay, Ushahidi] Can you screenshot the request?
Zeeshan Shah
@Zkage
Oct 23 2016 20:07
iv created a test user: id: ushbot@gmail.com and pwd is "password"
Ushbot
@ushbot
Oct 23 2016 20:08
[Robbie Mackay, Ushahidi] re: SMS. Best practices for tech set up? or for engaging users?
Tech set up is mostly covered in the support docs. User engagement etc.. I’m not the best person to answer but I can ask others.
Zeeshan Shah
@Zkage
Oct 23 2016 20:08
blob
blob
Also looking at your body there are a few errors (mostly because our bot mangled my responses above)
It should be client_secret and client_id .. no \ needed
you should just have "username":"user@safr.info"
the rest looks OK though
@Zkage ^^
Zeeshan Shah
@Zkage
Oct 23 2016 20:43
got it~
thanks~