NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

Authentication

The process flow is as such:

  1. Mobile App login with Facebook or Google**
  2. Mobile App get the token (from Fb/G)
  3. Send token to server via /api/v1/auth endpoint
  4. Then server checks if we already have the user in local db:

    a. If already in, return an auth token

    b. Else, create user, then return an auth token

The auth token is actually JWT token. Basically, to call an authorised endpoint, include the JWT token in the request header: Authorization: Bearer [JWTTokenHere]. The request will pass through if the token is valid. The user can also be identified with the token.

The token does expire. If server returns token_expired, call /api/v1/auth/refresh to get a new token. The token is returned in Authorization header.

To get the current logged in user based on the token, call /api/v1/me.

** Fb uses same client_id/secret, Google might be different. For example, for Android: https://developers.google.com/identity/sign-in/android/start-integrating

Get Authenticated User

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Retrieves the user associated with the JWT token.

Example request:

curl -X GET "http://localhost/api/v1/me" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/me",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/me

HEAD api/v1/me

Authenticate User

Exchanges social network token to JWT bearer token.

Example request:

curl -X POST "http://localhost/api/v1/auth" \
-H "Accept: application/json" \
    -d "service"="facebook" \
    -d "token"="in" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/auth",
    "method": "POST",
    "data": {
        "service": "facebook",
        "token": "in"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/auth

Parameters

Parameter Type Status Description
service string required facebook or google
token string required

Refresh Token

Example request:

curl -X GET "http://localhost/api/v1/auth/refresh" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/auth/refresh",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/auth/refresh

HEAD api/v1/auth/refresh

Booking

All bookings by passengers are handled here.

Get bookings belonging to a user

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns all offers belonging to user($id)

Example request:

curl -X GET "http://localhost/api/v1/users/me/bookings" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users/me/bookings",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/users/me/bookings

HEAD api/v1/users/me/bookings

Get all bookings belonging to an offer

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns all bookings made to an offer or 404

Example request:

curl -X GET "http://localhost/api/v1/offers/{offer_id}/bookings" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers/{offer_id}/bookings",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/offers/{offer_id}/bookings

HEAD api/v1/offers/{offer_id}/bookings

Get all bookings

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns all bookings in database

Example request:

curl -X GET "http://localhost/api/v1/bookings" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/bookings",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/bookings

HEAD api/v1/bookings

Create a booking

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Do not use pax, pax defaults to 1. For future use ONLY.

Returns Success or error message.

Example request:

curl -X POST "http://localhost/api/v1/bookings" \
-H "Accept: application/json" \
    -d "offer_id"="3331" \
    -d "pax"="3331" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/bookings",
    "method": "POST",
    "data": {
        "offer_id": 3331,
        "pax": 3331
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/bookings

Parameters

Parameter Type Status Description
offer_id integer required
pax integer optional

Show a particular booking

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns a single booking

Example request:

curl -X GET "http://localhost/api/v1/bookings/{booking}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/bookings/{booking}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/bookings/{booking}

HEAD api/v1/bookings/{booking}

Cancel a booking

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns success message or 404.

Example request:

curl -X DELETE "http://localhost/api/v1/bookings/{booking}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/bookings/{booking}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/v1/bookings/{booking}

Notification

Push notifications stuff with FCM is handled here.

Store device token

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Example request:

curl -X POST "http://localhost/api/v1/devices" \
-H "Accept: application/json" \
    -d "device_token"="possimus" \
    -d "platform"="web" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/devices",
    "method": "POST",
    "data": {
        "device_token": "possimus",
        "platform": "web"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/devices

Parameters

Parameter Type Status Description
device_token string required
platform string required ios, android or web

Delete device token

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Example request:

curl -X DELETE "http://localhost/api/v1/devices/{device}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/devices/{device}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/v1/devices/{device}

Get devices belonging to a user

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Example request:

curl -X GET "http://localhost/api/v1/users/me/devices" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users/me/devices",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/users/me/devices

HEAD api/v1/users/me/devices

Send test notification

Example request:

curl -X POST "http://localhost/api/v1/test-notification/{user_id}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/test-notification/{user_id}",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/test-notification/{user_id}

Offer

All offers by drivers are handled here.

Get offers belonging to a user

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns all offers belonging to user($id)

Example request:

curl -X GET "http://localhost/api/v1/offers-for-user" \
-H "Accept: application/json" \
    -d "user_id"="velit" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers-for-user",
    "method": "GET",
    "data": {
        "user_id": "velit"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/offers-for-user

HEAD api/v1/offers-for-user

Parameters

Parameter Type Status Description
user_id string optional Only alpha-numeric characters allowed

Get offers from Date

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

If no date given, today's date is used.

Returns all offers on a requested date

Example request:

curl -X GET "http://localhost/api/v1/offers-for-date" \
-H "Accept: application/json" \
    -d "date"="2017-05-27" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers-for-date",
    "method": "GET",
    "data": {
        "date": "2017-05-27"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/offers-for-date

HEAD api/v1/offers-for-date

Parameters

Parameter Type Status Description
date date optional Date format: Y-m-d

Get offers belonging to a user

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns all offers belonging to user($id)

Example request:

curl -X GET "http://localhost/api/v1/users/me/offers" \
-H "Accept: application/json" \
    -d "user_id"="qui" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users/me/offers",
    "method": "GET",
    "data": {
        "user_id": "qui"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/users/me/offers

HEAD api/v1/users/me/offers

Parameters

Parameter Type Status Description
user_id string optional Only alpha-numeric characters allowed

Get nearby offers

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Range accepts 1-12 (Precision of geohash, 1 = ~5000km, 12 = 3.7 cm. Defaults to 4)

Returns all nearby offers in the next 24 hours.

Example request:

curl -X POST "http://localhost/api/v1/nearby-offers" \
-H "Accept: application/json" \
    -d "lat"="15" \
    -d "lng"="31" \
    -d "range"="8" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/nearby-offers",
    "method": "POST",
    "data": {
        "lat": 15,
        "lng": 31,
        "range": 8
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/nearby-offers

Parameters

Parameter Type Status Description
lat numeric required Between: -90 and 90
lng numeric required Between: -180 and 180
range numeric optional Between: 1 and 12

Set an offer status to ongoing

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Status: Cancelled by User= 0, Pending = 1, Ongoing = 2, Completed = 3, Expired by server = 4.

Returns Success.

Example request:

curl -X POST "http://localhost/api/v1/offers/{offer_id}/ongoing" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers/{offer_id}/ongoing",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/offers/{offer_id}/ongoing

Set an offer status to completed

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Status: Cancelled by User= 0, Pending = 1, Ongoing = 2, Completed = 3, Expired by server = 4.

Returns Success.

Example request:

curl -X POST "http://localhost/api/v1/offers/{offer_id}/completed" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers/{offer_id}/completed",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/offers/{offer_id}/completed

Get all offers

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Not recommended for use

Returns ALL offers in database

Example request:

curl -X GET "http://localhost/api/v1/offers" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/offers

HEAD api/v1/offers

Store an offer

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns Validation errors OR success message w/ data posted

Example request:

curl -X POST "http://localhost/api/v1/offers" \
-H "Accept: application/json" \
    -d "meetup_time"="2017-05-27 15:44:23" \
    -d "start_name"="est" \
    -d "start_addr"="est" \
    -d "start_lat"="40" \
    -d "start_lng"="81" \
    -d "end_name"="est" \
    -d "end_addr"="est" \
    -d "end_lat"="40" \
    -d "end_lng"="81" \
    -d "vacancy"="8099169" \
    -d "remarks"="est" \
    -d "pref_gender"="female" \
    -d "vehicle_number"="est" \
    -d "vehicle_desc"="est" \
    -d "vehicle_model"="est" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers",
    "method": "POST",
    "data": {
        "meetup_time": "2017-05-27 15:44:23",
        "start_name": "est",
        "start_addr": "est",
        "start_lat": 40,
        "start_lng": 81,
        "end_name": "est",
        "end_addr": "est",
        "end_lat": 40,
        "end_lng": 81,
        "vacancy": 8099169,
        "remarks": "est",
        "pref_gender": "female",
        "vehicle_number": "est",
        "vehicle_desc": "est",
        "vehicle_model": "est"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/offers

Parameters

Parameter Type Status Description
meetup_time date required Date format: Y-m-d H:i:s
start_name string required
start_addr string required
start_lat numeric required Between: -90 and 90
start_lng numeric required Between: -180 and 180
end_name string required
end_addr string required
end_lat numeric required Between: -90 and 90
end_lng numeric required Between: -180 and 180
vacancy integer required
remarks string optional
pref_gender string optional male or female
vehicle_number string required Only alpha-numeric characters allowed
vehicle_desc string optional
vehicle_model string required

Show a single offer

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns a single offer from offer_id

Example request:

curl -X GET "http://localhost/api/v1/offers/{offer}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers/{offer}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/offers/{offer}

HEAD api/v1/offers/{offer}

Update an offer

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Returns success message or 404.

Example request:

curl -X PUT "http://localhost/api/v1/offers/{offer}" \
-H "Accept: application/json" \
    -d "meetup_time"="2017-05-27 15:44:23" \
    -d "start_name"="ratione" \
    -d "start_addr"="ratione" \
    -d "start_lat"="-64" \
    -d "start_lng"="-127" \
    -d "end_name"="ratione" \
    -d "end_addr"="ratione" \
    -d "end_lat"="-64" \
    -d "end_lng"="-127" \
    -d "vacancy"="97" \
    -d "remarks"="ratione" \
    -d "pref_gender"="male" \
    -d "vehicle_number"="ratione" \
    -d "vehicle_desc"="ratione" \
    -d "vehicle_model"="ratione" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers/{offer}",
    "method": "PUT",
    "data": {
        "meetup_time": "2017-05-27 15:44:23",
        "start_name": "ratione",
        "start_addr": "ratione",
        "start_lat": -64,
        "start_lng": -127,
        "end_name": "ratione",
        "end_addr": "ratione",
        "end_lat": -64,
        "end_lng": -127,
        "vacancy": 97,
        "remarks": "ratione",
        "pref_gender": "male",
        "vehicle_number": "ratione",
        "vehicle_desc": "ratione",
        "vehicle_model": "ratione"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

PUT api/v1/offers/{offer}

PATCH api/v1/offers/{offer}

Parameters

Parameter Type Status Description
meetup_time date required Date format: Y-m-d H:i:s
start_name string required
start_addr string required
start_lat numeric required Between: -90 and 90
start_lng numeric required Between: -180 and 180
end_name string required
end_addr string required
end_lat numeric required Between: -90 and 90
end_lng numeric required Between: -180 and 180
vacancy integer required
remarks string optional
pref_gender string optional male or female
vehicle_number string required Only alpha-numeric characters allowed
vehicle_desc string optional
vehicle_model string required

Cancel an offer

Requires Authentication Header - Authorization: Bearer [JWTTokenHere]

Status: Cancelled by User= 0, Pending = 1, Ongoing = 2, Completed = 3, Expired by server = 4.

Returns Success or 404.

Example request:

curl -X DELETE "http://localhost/api/v1/offers/{offer}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/offers/{offer}",
    "method": "DELETE",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/v1/offers/{offer}

Report

All reports are handled here

Set a report to Read

Requires admin role

Example request:

curl -X POST "http://localhost/api/v1/reports/{report_id}/set-read" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reports/{report_id}/set-read",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/reports/{report_id}/set-read

Set a report to Replied

Requires admin role

Example request:

curl -X POST "http://localhost/api/v1/reports/{report_id}/set-replied" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reports/{report_id}/set-replied",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/reports/{report_id}/set-replied

Display a listing of reports.

Requires admin role

Example request:

curl -X GET "http://localhost/api/v1/reports" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reports",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/reports

HEAD api/v1/reports

Display the specified report.

Requires admin role

Example request:

curl -X GET "http://localhost/api/v1/reports/{report}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reports/{report}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/reports/{report}

HEAD api/v1/reports/{report}

Store a newly created report in storage.

Example request:

curl -X POST "http://localhost/api/v1/reports" \
-H "Accept: application/json" \
    -d "title"="soluta" \
    -d "body"="soluta" \
    -d "email"="hope24@example.com" \
    -d "os"="android" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reports",
    "method": "POST",
    "data": {
        "title": "soluta",
        "body": "soluta",
        "email": "hope24@example.com",
        "os": "android"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/reports

Parameters

Parameter Type Status Description
title string required Maximum: 255
body string required
email email required
os string required ios or android

Review

All reviews by users are handled here.

Display a listing of the reviews

Example request:

curl -X GET "http://localhost/api/v1/reviews" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reviews",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/reviews

HEAD api/v1/reviews

Create a new review

To review an offer (and its driver), send offer_id.

To review a booking (and its passenger), send booking_id.

But don't send BOTH offer_id and booking_id. will fail.

Example request:

curl -X POST "http://localhost/api/v1/reviews" \
-H "Accept: application/json" \
    -d "offer_id"="157163" \
    -d "booking_id"="157163" \
    -d "body"="est" \
    -d "rating"="4" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reviews",
    "method": "POST",
    "data": {
        "offer_id": 157163,
        "booking_id": 157163,
        "body": "est",
        "rating": 4
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/reviews

Parameters

Parameter Type Status Description
offer_id integer optional Required if the parameters booking_id are not present.
booking_id integer optional Required if the parameters offer_id are not present.
body string required
rating integer required Between: 1 and 5

Display the specified review.

Example request:

curl -X GET "http://localhost/api/v1/reviews/{review}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reviews/{review}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/reviews/{review}

HEAD api/v1/reviews/{review}

api/v1/reviews-for-user

Example request:

curl -X GET "http://localhost/api/v1/reviews-for-user" \
-H "Accept: application/json" \
    -d "user_id"="enim" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reviews-for-user",
    "method": "GET",
    "data": {
        "user_id": "enim"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/reviews-for-user

HEAD api/v1/reviews-for-user

Parameters

Parameter Type Status Description
user_id string optional Only alpha-numeric characters allowed

api/v1/reviewer-reviews

Example request:

curl -X GET "http://localhost/api/v1/reviewer-reviews" \
-H "Accept: application/json" \
    -d "user_id"="est" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/reviewer-reviews",
    "method": "GET",
    "data": {
        "user_id": "est"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/reviewer-reviews

HEAD api/v1/reviewer-reviews

Parameters

Parameter Type Status Description
user_id string optional Only alpha-numeric characters allowed

Role

All methods relating to User Roles

Display a user's roles

Example request:

curl -X GET "http://localhost/api/v1/users/me/roles" \
-H "Accept: application/json" \
    -d "user_id"="temporibus" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users/me/roles",
    "method": "GET",
    "data": {
        "user_id": "temporibus"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/users/me/roles

HEAD api/v1/users/me/roles

Parameters

Parameter Type Status Description
user_id string optional Only alpha-numeric characters allowed

Display a listing of all roles

Example request:

curl -X GET "http://localhost/api/v1/roles" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/roles",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/roles

HEAD api/v1/roles

Add a role to user

Example request:

curl -X POST "http://localhost/api/v1/roles" \
-H "Accept: application/json" \
    -d "user_id"="quae" \
    -d "role"="admin" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/roles",
    "method": "POST",
    "data": {
        "user_id": "quae",
        "role": "admin"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/roles

Parameters

Parameter Type Status Description
user_id string required
role string required admin

Remove a role from user

Example request:

curl -X DELETE "http://localhost/api/v1/roles/{role}" \
-H "Accept: application/json" \
    -d "user_id"="sunt" \
    -d "role"="admin" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/roles/{role}",
    "method": "DELETE",
    "data": {
        "user_id": "sunt",
        "role": "admin"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

DELETE api/v1/roles/{role}

Parameters

Parameter Type Status Description
user_id string required
role string required admin

User

Only admins

Ban a user

Example request:

curl -X POST "http://localhost/api/v1/users/ban" \
-H "Accept: application/json" \
    -d "user_id"="numquam" \
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users/ban",
    "method": "POST",
    "data": {
        "user_id": "numquam"
},
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/users/ban

Parameters

Parameter Type Status Description
user_id string optional Only alpha-numeric characters allowed

Display a listing of all users

Example request:

curl -X GET "http://localhost/api/v1/users" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/users

HEAD api/v1/users

Display all info about selected user

Example request:

curl -X GET "http://localhost/api/v1/users/{user}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/users/{user}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/users/{user}

HEAD api/v1/users/{user}

general

Place your BotMan logic here.

Example request:

curl -X GET "http://localhost/api/v1/fb-webhook" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/fb-webhook",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

null

HTTP Request

GET api/v1/fb-webhook

POST api/v1/fb-webhook

HEAD api/v1/fb-webhook