These are chat archives for ushahidi/Community

15th
Nov 2016
tameen
@tameen
Nov 15 2016 06:12
@ushbot
Ushbot
@ushbot
Nov 15 2016 07:19
[Angela Oduor Lungati, Ushahidi] Hi Tameen - i’m flagging this for the rest of the team to help
tameen
@tameen
Nov 15 2016 08:23
hello
please read my queries
above
@aoduor
api is not working although i successfully installed platform and platform-client
thanks for quick response and for flagging. @aoduor
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:30
@tameen i see you got sorted
tameen
@tameen
Nov 15 2016 08:30
nope
i am still facing this issue.
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:31
@tameen i left when you had an issue with the mysql
was it sorted?
tameen
@tameen
Nov 15 2016 08:31
yeah that issue is solved
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:44
@tameen may i ask what the issue was?
tameen
@tameen
Nov 15 2016 08:45
mysql installation . i just reinstall mysql and all works well
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:46
ooh nice. Well thats now user experience you can use to help someone else as well @tameen
tameen
@tameen
Nov 15 2016 08:46
yes ! and thanks a lot :)
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:47
@tameen anytime sir.
tameen
@tameen
Nov 15 2016 08:47
what about your issues?
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:48
@tameen my deployment worked
also had an issue with the API
tameen
@tameen
Nov 15 2016 08:48
great
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:49
but i realized i had too many errors as a newbie in setting up the virtual hosts @tameen
so once i went through and found commas where they were not to be it went great
tameen
@tameen
Nov 15 2016 08:49
great to know :+1: .... how did you solve api issue because i am facing the same.
@d_samuraiNick_twitter
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:51
@tameen what errors are showing on yours?
tameen
@tameen
Nov 15 2016 08:52
The requested URL /platform/httpdocs/api/v3/config/ was not found on this server.
i have uploaded all details in my last message.
*messages.
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:53
@tameen have you tested with both the virtual host name you used and IP address?
lemme go through
@tameen they have not connected.
tameen
@tameen
Nov 15 2016 08:54
how do to this
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:54
might even be a typo like mine @tameen
may you post your virtual host settings
tameen
@tameen
Nov 15 2016 08:55
yes sure
@d_samuraiNick_twitter can i catch you after an hour. i have got an unexpected meeting call . :(
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:58
no prob @tameen
tameen
@tameen
Nov 15 2016 08:58
platform-api.png
client-server-www.png
platform.png
platform-httpdocs.png
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 08:58
found where problem might be though
@tameen
tameen
@tameen
Nov 15 2016 08:59
yes just post here and i wil try - thanks will catch you then . @d_samuraiNick_twitter
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 09:00
@tameen your server name may need to change and there isnt an alias on the files as well
@tameen and show what your hosts file indicates on the terminal
TheNiqabiCoderMum
@nqcm
Nov 15 2016 09:13
@d_samuraiNick_twitter thanks!
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 09:13
@Theniqabicodermum did the video help?
TheNiqabiCoderMum
@nqcm
Nov 15 2016 09:17
checking it out now :)
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 09:17
@Theniqabicodermum coll all the best
tameen
@tameen
Nov 15 2016 10:11
@d_samuraiNick_twitter what should be servername?
Screenshot from 2016-11-15 15:12:44.png
tameen
@tameen
Nov 15 2016 12:44
@d_samuraiNick_twitter @ushbot @aoduor - anyone?
tameen
@tameen
Nov 15 2016 14:44
:worried:
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 15:30
@tameen im here
no do ' sudo /etc/hosts' and show me the result please
example is like:
'Servername yourdomainname.tld
sorry edit it to 'sudo gedit /etc/hosts' @tameen
tameen
@tameen
Nov 15 2016 15:53
Screenshot from 2016-11-15 20:52:55.png
@d_samuraiNick_twitter
thanks God someone is here
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 15:54
@tameen there is no provision for the other server
lemme send you my example and use that to make your virtual server
tameen
@tameen
Nov 15 2016 15:55
are you asking or are telling me
okay
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 15:56
@tameen i was correcting the image. There is no server provision for the other two servers separately
Screenshot from 2016-11-11 15-02-00.png
Screenshot from 2016-11-11 11-49-45.png
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 15:57
@tameen kindly use the two examples for your edits then share if you may
yes you can
tameen
@tameen
Nov 15 2016 15:58
ok let me do this and please stay here, i really need to complete this.
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 15:59
@tameen cool
tameen
@tameen
Nov 15 2016 16:24
i have created 2 domains and saved them in host but they are not working
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:25
you restarted apache?
and may i see the host file @tameen
tameen
@tameen
Nov 15 2016 16:26
yes
this is host file

127.0.0.1 localhost
127.0.1.1 tameen-ThinkPad-E520
127.0.0.2 tameenexample.com
127.0.0.3 tameentest.com

The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

i myself added these two line in host file:
127.0.0.2 tameenexample.com
127.0.0.3 tameentest.com
okay i restarted my apache 2 3 times and it works
@d_samuraiNick_twitter
now let me add platform and client in their folders
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:29
and in the individual files did you add the ip addresses where the *:80 is?
then whichever one is the platform is the one you put in the backend url
tameen
@tameen
Nov 15 2016 16:30
yes sir
it works , now i am adding platform and client folders in these two
Screenshot from 2016-11-15 21:32:08.png
now my base_url should be like this?
@d_samuraiNick_twitter
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:36
I did not change it to that for mine
index_file is what i chaged to 'index.php' @tameen
Screenshot from 2016-11-15 19-38-53.png
Screenshot from 2016-11-15 19-41-00.png
tameen
@tameen
Nov 15 2016 16:43
but in my case its returning this if i copy your file
tameenexample.png
can you please share your virtual host config file
?
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:46
Is it different if you use it in the base URL?
tameen
@tameen
Nov 15 2016 16:46
yes
i think my document root is not correct
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:47
So that means on yours with your configuration it works better
tameen
@tameen
Nov 15 2016 16:47
<VirtualHost *:80>
ServerAdmin admin@tameenexample.com
ServerName tameenexample.com
ServerAlias www.tameenexample.com
DocumentRoot /var/www/tameenexample.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
see ???
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:48
Yeah it should lead to httpdocs folder if for platform
tameen
@tameen
Nov 15 2016 16:48
can you correct this. i mean which line i need to change
?
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:48
And www/server if for platform-client
tameen
@tameen
Nov 15 2016 16:48
its for platform api
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:49
Ooh okay
For platform put a path to httpdocs all the way where exactly the required root is
tameen
@tameen
Nov 15 2016 16:51
like this?
<VirtualHost *:80>
ServerAdmin admin@tameenexample.com
ServerName tameenexample.com
ServerAlias www.tameenexample.com
DocumentRoot /var/www/tameenexample.com/public_html/platform/httpdocs/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 16:51
Screenshot from 2016-11-11 11-49-45.png
yup
then try the api test and see the json output
be back in like 30 @tameen
tameen
@tameen
Nov 15 2016 16:54
let me copy this
The requested URL /api/v3/config/site was not found on this server.
:'(
:(
tameen
@tameen
Nov 15 2016 17:02
@d_samuraiNick_twitter what's api link should be
?
i got something like this:
api.png
tameen
@tameen
Nov 15 2016 17:08
@d_samuraiNick_twitter
tameen
@tameen
Nov 15 2016 17:14
apiv3.png
client.png
i got this
@d_samuraiNick_twitter
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:17
Base URL?
tameen
@tameen
Nov 15 2016 17:18
NODE_SERVER=true
BACKEND_URL=http://tameenexample.com/
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:18
Put httpdocs
And hopefully you will have it up
tameen
@tameen
Nov 15 2016 17:18
like : NODE_SERVER=true
BACKEND_URL=http://tameenexample.com/platform/httpdocs
?
@d_samuraiNick_twitter
oh yes it works. Thanks my Allah ... thanks a lot @d_samuraiNick_twitter .... you are :+1: ... Stay Blessssssed !
i am so thankful to you @d_samuraiNick_twitter ... stay happpyyyy ...
:clap: :clap: :clap: :clap:
tameen
@tameen
Nov 15 2016 17:43
and one last thing how to get api of posts?
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:47
Api of posts how?
That's on the client side
tameen
@tameen
Nov 15 2016 17:48
like i have created post on client and get its api?
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:48
And glad it works @tameen
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:49
Lemme read and get back
tameen
@tameen
Nov 15 2016 17:49
ok
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:49
You want to call it somewhere else?
tameen
@tameen
Nov 15 2016 17:50
yes
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:50
To display data on another platform
tameen
@tameen
Nov 15 2016 17:50
exactly
Fragile masculinity
@d_samuraiNick_twitter
Nov 15 2016 17:50
For this version I'm still really new so maybe as I update if I learn I look for you and help
When I learn not if
tameen
@tameen
Nov 15 2016 17:51
ok sure , before v3 i downloaded and installed v2 and its api was too good but i don't know how to access posts via v3 api
Nesp
@Nesp
Nov 15 2016 18:24
@tameen try to use postman it's an extension for google chrome you can use to try out complicated api erquests which are not just made of a url but they have a header body and other things
the v2 was easy to use, then when switching to v3 I saw things were more complicated. Thanks to @ushbot I learned to use postman
fisr you need to get and Oauth access token
tameen
@tameen
Nov 15 2016 18:26
really?? now i want to learn this too
Nesp
@Nesp
Nov 15 2016 18:26
I will help
tameen
@tameen
Nov 15 2016 18:26
how to get this?
so nice of you @Nesp
Nesp
@Nesp
Nov 15 2016 18:30

token request:

POST     http://yourapiurl/oauth/token

Header : 
Basic ABCDEF

Body:
{"grant_type":"client_credentials","client_id":"ushahidiui","client_secret":"35e7f0bca957836d05ca0492211b0ac707671261","scope":"posts media forms api tags savedsearches sets users stats layers config messages notifications contacts roles permissions csv"}

for the body choose the 'raw' option

the request looks like this
tameen
@tameen
Nov 15 2016 18:31
great sir, let me do this
Nesp
@Nesp
Nov 15 2016 18:32
blob
blob
what you get looks like this
tameen
@tameen
Nov 15 2016 18:39
Screenshot from 2016-11-15 23:39:10.png
should i add ?
Nesp
@Nesp
Nov 15 2016 18:40
blob
you have to copy the access_token
you need the interceptor, not the sync
blob
once you get the access token you can copy paste it in the requests to get the posts
blob
tameen
@tameen
Nov 15 2016 18:45
Tapi.png
404 error why?
i need to access http://tameenexample.com/oauth/token first?
tameen
@tameen
Nov 15 2016 18:51
oauth2.0.png
@Nesp
Nesp
@Nesp
Nov 15 2016 23:45
@tameen sorry my laptop died
the authorization on both requests is No Auth
they told me some semi official info on API use can be found here