/own_social_network_test

This application would start with features like "Friend", "Unfriend", "Block", "Receive Updates"

Primary LanguageJavaScript

Own Social Network Test

This application would start with features like "Friend", "Unfriend", "Block", "Receive Updates"

Technology:

Ruby on Rails, Heroku, postgresql, REST API, Git

1. As a user, I need an API to create a friend connection between two email addresses.

Request URL:

https://own-social-network.herokuapp.com/api/users/create_friend

JSON request:

{
	"friends":
		[
		'andy@example.com',
		'john@example.com'
		]
}

JSON responses:

{
	"success": true
}

2. As a user, I need an API to retrieve the friends list for an email address.

Request URL:

https://own-social-network.herokuapp.com/api/users/all_friends

JSON request:

{
	"email": 'andy@example.com'
}

JSON response:

{
    "success": true,
    "friends": [
        "john@example.com",
        "andy_comman@example.com",
        "comman_friend_andy_john@example.com",
        "john@example.com"
    ],
    "count": 4
}

3. As a user, I need an API to retrieve the common friends list between two email addresses.

Request URL:

https://own-social-network.herokuapp.com/api/users/common_friends

I am working for issue

JSON request:

{
	"friends":
		[
		'andy@example.com',
		'john@example.com'
		]
}

JSON response:

{
    "success": true,
    "friends": [
        "comman_friend_andy_john@example.com"
    ],
    "count": 1
}

4. As a user, I need an API to subscribe to updates from an email address.

Request URL:

https://own-social-network.herokuapp.com/api/users/subscribe

JSON request:

{
	"requestor": "lisa@example.com",
	"target": "john@example.com"
}

JSON response:

{
	"success": true
}

If requester will pass same user again and again then respose will be as below:

{
    "success": false,
    "message": "Subscription already exist!"
}

5. As a user, I need an API to block updates from an email address.

Request URL:

https://own-social-network.herokuapp.com/api/users/block

JSON request:

{
	"requestor": "andy@example.com",
	"target": "john@example.com"
}

JSON response

{
	"success": true
}

6. As a user, I need an API to retrieve all email addresses that can receive updates from an email address.

Request URL:

https://own-social-network.herokuapp.com/api/users/receive_update

JSON request:

{
	"sender": "john@example.com",
	"text": "Hello World! kate@example.com"
}

JSON response:

{
    "sucess": true,
    "receipients": [
        "kate@example.com",
        "lisa@example.com"
    ]
}

Notes - for local machine testing:

Import in postman chrome ext app

Author:

uday Kumar