{"id":18780416,"url":"https://github.com/karan/pillar-api","last_synced_at":"2025-12-18T19:30:16.073Z","repository":{"id":65984361,"uuid":"18014524","full_name":"karan/Pillar-API","owner":"karan","description":"API for backend of Suicide Prevention App","archived":false,"fork":false,"pushed_at":"2014-03-23T18:01:12.000Z","size":315,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T07:10:55.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/karan/Pillar","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-22T16:50:23.000Z","updated_at":"2025-02-01T17:03:08.000Z","dependencies_parsed_at":"2023-02-19T18:10:19.491Z","dependency_job_id":null,"html_url":"https://github.com/karan/Pillar-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karan%2FPillar-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karan%2FPillar-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karan%2FPillar-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karan%2FPillar-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karan","download_url":"https://codeload.github.com/karan/Pillar-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239695912,"owners_count":19682144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T20:26:19.673Z","updated_at":"2025-12-18T19:30:16.002Z","avatar_url":"https://github.com/karan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pillar API\n===\n\nAccess at\nhttp://spa-api.herokuapp.com/\n\nRunning locally\n====\n\n1. `cd api`\n\n2. Install node.js dependencies\n\n        npm install\n\n3. Start mongo\n\n        mongod --dbpath data/\n\n4. Start the app\n\n        node app.js\n\n==================\n\n## API End Points\n\n#### User data returned in each response\n\n    {\n        \"response\": \"OK\",\n        \"user\": {\n            \"__v\": 0,\n            \"_id\": \"532d703b5331699ae745db51\",\n            \"username\": \"tu\",\n            \"scores\": [\n                {\n                    \"score\": 5,\n                    \"_id\": \"532d70425331699ae745db52\",\n                    \"timestamp\": \"2014-03-22T11:14:40.710Z\"\n                },\n                {\n                    \"score\": 5,\n                    \"_id\": \"532d704a5331699ae745db53\",\n                    \"timestamp\": \"2014-03-22T11:14:40.710Z\"\n                },\n                {\n                    \"score\": 10,\n                    \"_id\": \"532d70935e3e83f5e77b9e85\",\n                    \"timestamp\": \"2014-03-22T11:14:27.218Z\"\n                }\n            ],\n            \"created_at\": \"2014-03-22T11:12:59.250Z\"\n        }\n    }\n\n#### Sign up a user\n\n`POST /signup`\n\nForm needed:\n\n    username: phone's id\n\nIn case of an error:\n\n    {\n        \"response\": \"FAIL\",\n        \"errors\": [\n            \"User already exists\"\n        ]\n    }\n\n#### Login the user\n\n`POST /signing`\n\nForm needed:\n\n    username: phone's id\n\nIn case user not found:\n\n    {\n        \"response\": \"FAIL\",\n        \"errors\": [\n            \"User not found\"\n        ]\n    }\n\n#### Add a score\n\n`POST /addscore`\n\nForm needed:\n\n    score: the new score to add\n\n#### Add a new message for logged in user\n\n`POST addmessage`\n\nForm needed:\n\n    message: message body (**must** be 10-2000 characters)\n\nResponse:\n\n    {\n        \"response\": \"OK\",\n        \"message\": {\n            \"__v\": 0,\n            \"message\": \"o thou art\",\n            \"username\": \"tu\",\n            \"_id\": \"532d7f7b0ae6fd58f7dc129a\",\n            \"created_at\": \"2014-03-22T12:18:03.217Z\"\n        }\n    }\n\n#### Get all messages posted by logged in user\n\n`GET /mymessages`\n\nResponse:\n\n    {\n        \"response\": \"OK\",\n        \"messages\": [\n            {\n                \"message\": \"\\\"hello world\\\"\",\n                \"username\": \"tu\",\n                \"_id\": \"532d7f710ae6fd58f7dc1299\",\n                \"__v\": 0,\n                \"created_at\": \"2014-03-22T12:17:53.550Z\"\n            },\n            {\n                \"message\": \"o thou art\",\n                \"username\": \"tu\",\n                \"_id\": \"532d7f7b0ae6fd58f7dc129a\",\n                \"__v\": 0,\n                \"created_at\": \"2014-03-22T12:18:03.217Z\"\n            }\n        ]\n    }\n\n#### Get all messages on the network except those by logged in user, sortest by timestamp\n\n`GET /allmessages`\n\nResponse:\n\n    {\n        \"response\": \"OK\",\n        \"messages\": [\n            {\n                \"message\": \"o thou art\",\n                \"username\": \"tu\",\n                \"_id\": \"532d7f7b0ae6fd58f7dc129a\",\n                \"__v\": 0,\n                \"created_at\": \"2014-03-22T12:18:03.217Z\"\n            },\n            {\n                \"message\": \"\\\"hello world\\\"\",\n                \"username\": \"tu\",\n                \"_id\": \"532d7f710ae6fd58f7dc1299\",\n                \"__v\": 0,\n                \"created_at\": \"2014-03-22T12:17:53.550Z\"\n            }\n        ]\n    }\n\n#### Get a random quote from the bible\n\n`GET /getquote`\n\nResponse:\n\n    {\n        \"response\": \"OK\",\n        \"quote\": {\n            \"title\": \"1 John 5:4\",\n            \"preview\": \"because everyone who is fathered by God conquers the world. \\r\\nAnd this is the victory which has conquered the world: our faith.\"\n        }\n    }\n\n##### Reply to an existing message\n\n`POST sendmessage`\n\nForm needs:\n\n    messageID - objectID of the message to which this is a reply\n    message - body of the message\n    messageTitle - title of the message (1 John 5: or empty)\n\nResponse:\n\n    {\n        \"response\": \"OK\",\n        \"message\": {\n            \"__v\": 0,\n            \"_id\": \"532d7f710ae6fd58f7dc1299\",\n            \"message\": \"\\\"hello world\\\"\",\n            \"username\": \"tu\",\n            \"replies\": [\n                {\n                    \"message\": \"this is a testing message reply\",\n                    \"title\": \"\",\n                    \"_id\": \"532dccd88636f300005e9e80\",\n                    \"timestamp\": \"2014-03-22T17:48:08.650Z\"\n                }\n            ],\n            \"created_at\": \"2014-03-22T12:17:53.550Z\"\n        }\n    }\n\n#### Get details of a given message\n\n`GET /getmessage`\n\nParams:\n\n    messageID - the id of the message\n\nResponse\n\n    {\n        \"response\": \"OK\",\n        \"messages\": {\n            \"message\": \"\\\"hello world\\\"\",\n            \"username\": \"tu\",\n            \"_id\": \"532d7f710ae6fd58f7dc1299\",\n            \"__v\": 0,\n            \"created_at\": \"2014-03-22T12:17:53.550Z\"\n        }\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaran%2Fpillar-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaran%2Fpillar-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaran%2Fpillar-api/lists"}