inSquare API

Geolocalized interactions through inSquare API
More information: http://insquare.it
Version: 2.0.0
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

  1. patch /apnToken
  2. delete /favouritesquares
  3. get /favouritesquares/{id}
  4. post /favouritesquares
  5. patch /gcmToken
  6. get /messages
  7. post /notifyEvent
  8. post /notifyFavourers
  9. post /notifyRecents
  10. get /profilePictures/{userId}
  11. delete /recentSquares
  12. get /recentSquares/{userId}
  13. post /recents
  14. delete /squares
  15. get /squares
  16. get /squares/{id}
  17. patch /squares
  18. post /squares
  19. get /user
  20. patch /user
Up
patch /apnToken
Post the user frontend GCM push token on server (apnTokenPatch)

Query parameters

isApple (required)
Query Parameter — Must be set to true
userId (required)
Query Parameter
token (required)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Ok

0

unexpected error

Up
delete /favouritesquares
Remove a Square from favourites squares of a User (favouritesquaresDelete)

Query parameters

userId (required)
Query Parameter — The User ID
squareId (required)
Query Parameter — The square you want to remove from a User Favourite

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

La square \u00E8 stata aggiunta come preferita

0

unexpected error

Up
get /favouritesquares/{id}
Favorite squares of a User (favouritesquaresIdGet)

Path parameters

id (required)
Path Parameter — The user Id

Return type

Square

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Favourite squares of a specified used

0

unexpected error

Up
post /favouritesquares
Match a square with the Favourite Squares of a User (favouritesquaresPost)

Query parameters

userId (required)
Query Parameter — The User ID
squareId (required)
Query Parameter — The new favourite square ID of the User

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

La square \u00E8 stata aggiunta come preferita

0

unexpected error

Up
patch /gcmToken
Post the user frontend GCM push token on server (gcmTokenPatch)

Request body

GCM (required)
Body Parameter — The user ID

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

GCM TOKEN on Server

0

unexpected error

Up
get /messages
Get alist of messages from a square (messagesGet)

Query parameters

square (required)
Query Parameter — Square ID
size (required)
Query Parameter — The maximum number of messages you want.
recent (required)
Query Parameter — Must be true

Return type

array[Message]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

A list of messages on a square

0

Malformed query

Up
post /notifyEvent
Notify to all users a specified event (notifyEventPost)

Query parameters

squareId (required)
Query Parameter
userId (required)
Query Parameter
event (required)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Ok

0

unexpected error

Up
post /notifyFavourers
Notify to favourite users an event message (notifyFavourersPost)

Query parameters

squareId (required)
Query Parameter
userId (required)
Query Parameter
text (required)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Ok

0

unexpected error

Up
post /notifyRecents
Notify to recent users an event message (notifyRecentsPost)

Query parameters

squareId (required)
Query Parameter
userId (required)
Query Parameter
text (required)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Ok

0

unexpected error

Up
get /profilePictures/{userId}
Get the url of user's Profile Picture from Google or Facebook (profilePicturesUserIdGet)

Path parameters

userId (required)
Path Parameter — User ID

Return type

String

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Photo Profile URL

0

Malformed query

Up
delete /recentSquares
Remove a recent Squares from a specfied User (recentSquaresDelete)

Query parameters

userId (required)
Query Parameter
squareId (required)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Recenti eliminate

0

Recenti non eliminate, userId non valido

Up
get /recentSquares/{userId}
Recent squares of a User (recentSquaresUserIdGet)

Path parameters

userId (required)
Path Parameter — The user Id

Return type

array[Square]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Recent squares of a specified used

0

unexpected error

Up
post /recents
Add to a user a recent square (recentsPost)

Query parameters

squareId (required)
Query Parameter
userId (required)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Ok

0

unexpected error

Up
delete /squares
Delete a square by id and owner (squaresDelete)

Query parameters

squareId (required)
Query Parameter
ownerId (optional)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Square eliminata con successo!

0

unexpected error

Up
get /squares
(squaresGet)
Squares by ownerId, name or topic

Query parameters

byOwner (optional)
Query Parameter — Execute a search by ownerId
byTopic (optional)
Query Parameter — Execute a search by a topic
autocomplete (optional)
Query Parameter — Owr backend tries to guess the square that match most.
ownerId (optional)
Query Parameter — The userID of the square's owner
name (optional)
Query Parameter — Name of the square or topic you want to search.
lat (optional)
Query Parameter — Latitude of the user.
lon (optional)
Query Parameter — Longitude of the user.

Return type

array[Square]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The squares you searched ordered by distance from your location if provided. The query returns maximum 10000 squares.

0

Invalid query

Up
get /squares/{id}
Get square by id (squaresIdGet)

Path parameters

id (required)
Path Parameter — The ID of the square to fetch

Return type

Square

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Square with the specified ID

0

unexpected error

Up
patch /squares
(squaresPatch)
Update the description of a specified square

Query parameters

squareId (required)
Query Parameter — Square ID
ownerId (required)
Query Parameter
description (optional)
Query Parameter — Description to update
name (optional)
Query Parameter
expireTime (optional)
Query Parameter

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

La descrizione square \u00E8 stata modificata

0

unexpected error

Up
post /squares
(squaresPost)
Creates a new square. Duplicates are allowed

Request body

square (required)
Body Parameter — Square to add

Return type

Square

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

square response

0

unexpected error

Up
get /user
Get users on the square or get the last location of a specified user (userGet)

Query parameters

byLocation (optional)
Query Parameter — True if you want to get User last location
userId (optional)
Query Parameter — The id of the user you want to retrive the last location
squareId (optional)
Query Parameter — The square ID
distance (optional)
Query Parameter — The maximum distance from the square.

Return type

User

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Last location of a user or an array of users

0

unexpected error

Up
patch /user
Update the current user's location (userPatch)

Request body

user (required)
Body Parameter — The user

Return type

StatusMessage

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

User lastLocation update SUCCESSFUL

0

User lastLocation update NOT SUCCESSFUL

Up

Models

[ Jump to Methods ]

Table of Contents

  1. Error
  2. GCM
  3. Message
  4. NewMessage
  5. NewSquare
  6. NewUser
  7. Square
  8. StatusMessage
  9. User

Error Up

code
Integer
message
String

GCM Up

userId
String
gcm
String

Message Up

text
String
createdAt
date
senderId
User
squareId
Square
id
String

NewMessage Up

text
String
createdAt
date
senderId
User
squareId
Square

NewSquare Up

name
String
lat
String
lon
String
ownerId
String
description
String
facebookIdPage
String
facebookIdEvent
String
expireTime
String
type
String

NewUser Up

lat
String
lon
String

Square Up

name
String
lat
String
lon
String
ownerId
String
description
String
facebookIdPage
String
facebookIdEvent
String
expireTime
String
type
String
id
String

StatusMessage Up

code
Integer
message
String

User Up

lat
String
lon
String
id
String