Mock server for FIRE.
$ git clone [email protected]:EyeSeeTea/FIRE-MockServer.git
$ cd FIRE-MockServer
$ virtualenv -p /path/to/your/system/python3 env
$ env/bin/pip install -r requirements.txt
$ FLASK_APP=fire.py FLASK_DEBUG=1 .env/bin/flask run --host=127.0.0.1
See the example models to see the available users and other resources.
You can use curl
with basic authentication (-u user:password
, see models.users
).
- Get the list of users:
Example with curl:
$ curl -u joel:joel1234 -sS https://localhost:5000/users -X GET
{...}
Example from AngularJS:
const url = "https://dev.eyeseetea.com:5000/users/3";
const headers = {'Authorization': 'Basic ' + btoa("joel:joel1234")};
http.get(url, {headers}).subscribe(response => console.log(response.json()));
- Send a message to a user:
$ curl -u joel:joel1234 -sS https://localhost:5000/users/3/messages \
-X POST -H "Content-Type: application/json" \
-d '{"text": "Hello there"}'
- POST /newUserRequests : NewUserRequest -> STATUS
-
GET /notifications -> [Notification]
-
POST /newUserRequests/{id}/acceptation -> STATUS
-
POST /newUserRequests/{id}/rejection -> STATUS
-
GET /users -> [User]
-
GET /users/{id} -> User
-
PATCH /users/{id} User -> STATUS
-
DELETE /users/{id} -> STATUS
-
GET /users/{id}/messages -> [Message]
-
POST /users/{id}/messages : Message -> STATUS
- GET /pricing -> Pricing
- PATCH /pricing : Pricing -> STATUS
- GET /callPricing/{number} -> callPricing
- GET /users/{id}/vouchers -> [Voucher]
- POST /users/{id}/vouchers : Voucher -> STATUS
- PATCH /users/{id} : User -> STATUS
- id: Int
- user: User
- created: Date
- updated: Date
- adminUser: User
- state: String ("pending" | "accepted" | "rejected")
- id: Int
- name: String
- username: String
- address: String
- avatarUrl: String
- email: String
- gender: String ("male" | "female")
- state: String ("pending" | "active")
- phoneNumber: String
- created: Date
- updated: Date
- lastAccess: Date
- id: Int
- created: Date
- seen: Bool
- type: String
- "newUserRequest". Extra fields:
- newUserRequest: NewUserRequest
- "newUserAccepted". Extra fields:
- newUserRequest: NewUserRequest
- "messageSent". Extra fields:
- message: Message
- "profileUpdated". Extra fields:
- user: User
- "toppedUp". Extra fields:
- voucher: Voucher
- "newUserRequest". Extra fields:
- id: Int
- fromUser: User
- toUser: User
- text: String
- created: Date
- id: Int
- user: User
- state: String ("inactive" | "active" | "depleted")
- creditRemaining: Number
- creditTotal: Number
- code: String
- url: String
- bulkNumber: String
- Vendor: String
- created: Date
- activated: Date
- depleted: Date
- localMobile: Number
- localLandLines: Number
- nationalMobile: Number
- nationalLandLines: Number
- international (List):
- country: String
- mobile: Number
- landLines: Number
- gsm: Number
- voip: Number