Rest

List of application
POST /getApplication.php
List of application.
List of brand
POST /getBrand.php
List of brand.
List of model
POST /getModel.php
List of model.
List of screen media
POST /getScreenMedia.php
List of screen media.
List of unit
GET /getUnit.php
List of unit.
List of vibration type
 None
List of vibration type.
List of side
GET /getSide.php
List of side.
List of ellipse type
 None
List of ellipse type.
Create a machine vibration test
POST /setMachineEntry.php
Create a machine vibration test.
Create a machine vibration side
POST /setMachineEntrySide.php
Create a machine vibration side.
Create a machine vibration side data
POST /setMachineEntrySideData.php
Create all machine vibration side data.
Create a machine vibration side ellipse
POST /setMachineEntrySideEllipse.php
Create all machine vibration side ellipse.
Create a machine vibration inclination
POST /setMachineEntryInclination.php
Create a machine vibration inclination.
Create a machine vibration inclination data
POST /setMachineEntryInclinationData.php
Create all machine vibration inclination data.

Login

POST  /login.php

Get a token for all call. Token must be add as a "t" Post params for all call.

Request attributes

Login string User login
Password string Password

Sample Request

{
   'user': 'stephen@mbientlab.com',
   'password': 'MMMmmm444'
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'token': '8a81f5f66c973285e17d89026d31d47c'
}

Refresh token

POST  /refresh.php

To now if token is valide or refresh it.

Request attributes

Token string login token

Sample Request

{
  't': '8a81f5f66c973285e17d89026d31d47c'
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'token': '8a81f5f66c973285e17d89026d31d47c'
}

Get all application

POST  /getApplication.php
		

Get all application for drop-down list.

Request attributes

Token string login token
Date Date (dd-mm-yyyy) Date of last request

Sample Request

{
   't': '8a81f5f66c973285e17d89026d31d47c',
   'd': '30-01-2017'
}

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
{
	"code":"0",
	"message":"success",
	"application":[
		{
			"data":"7",
			"label":"Aggregates",
			"active":"1"
		},{
			"data":"4",
			"label":"Asphalt",
			"active":"1"
		},{
			"data":"10",
			"label":"Coal",
			"active":"1"
		},{
			"data":"6",
			"label":"Filter Sand",
			"active":"1"
		}
	]
}
			

Get all brand

POST  /getBrand.php
		

Get all brand for drop-down list.

Request attributes

Token string login token
Date Date (dd-mm-yyyy) Date of last request

Sample Request

{
   't': '8a81f5f66c973285e17d89026d31d47c',
   'd': '30-01-2017'
}

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
{
	"code":"0",
	"message":"success",
	"brand":[
		{
			"data":"7",
			"label":"Cedarrapids",
			"active":"1"
		},{
			"data":"4",
			"label":"Haver Niagara",
			"active":"1"
		},{
			"data":"10", "label":"Kleemann", "active":"1"
		},{
			"data":"6", "label":"Mogensen", "active":"1"
		}
	]
}
			

Get all Model

POST  /getModel.php
		

Get all model for drop-down list.

Request attributes

Token string login token
Date Date (dd-mm-yyyy) Date of last request

Sample Request

{
   't': '8a81f5f66c973285e17d89026d31d47c',
   'd': '30-01-2017'
}

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
{
	"code":"0",
	"message":"success",
	"model":[
		{
			"data":"9",
			"id_brand":"4",
			"id_vibration_type":"1",
			"label":"double",
			"active":"1"
		},{
			"data":"8",
			"id_brand":"4",
			"id_vibration_type":"3",
			"label":"Tripple",
			"active":"1"
		},{
			"data":"15",
			"id_brand":"10",
			"id_vibration_type":"1",
			"label":"F-Class",
			"active":"1"
		},{
			"data":"16",
			"id_brand":"10",
			"id_vibration_type":"2",
			"label":"Fineline",
			"active":"1"
		}
	]
}
			

Get all screen media

POST  /getScreenMedia.php
		

Get all screen media for drop-down list.

Request attributes

Token string login token
Date Date (dd-mm-yyyy) Date of last request

Sample Request

{
   't': '8a81f5f66c973285e17d89026d31d47c',
   'd': '30-01-2017'
}

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
{
	"code":"0",
	"message":"success",
	"screen_media":[
		{
			"data":"1", "label":"FM Modular Series D", "active":"1"
		},{
			"data":"2", "label":"FM Modular Series S", "active":"1"
		},{
			"data":"3", "label":"FM Modular Series T", "active":"1"
		}
	]
}
			

Get all unit

GET  /getUnit.php
		

Get all unit for radio button (Never change).

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
{
	"code":"0",
	"message":"success",
	"unit":[
		{
			"data":"2",
			"label":"imperial"
		},{
			"data":"1",
			"label":"metric (mm)"
		}
	]
}
			

All vibration type

Don't have
		

All vibration type (Never change).

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
			{
				"code":"0",
				"message":"success",
				"unit":[
					{
						"data":"3",
						"label":"Elliptical"
					},{
						"data":"2",
						"label":"Linear"
					},{
						"data":"1",
						"label":"Circular"
					}
				]
			}
			

Get all deck side

GET  /getSide.php
		

Get all Side for information (Never change).

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
{
	"code":"0",
	"message":"success",
	"side":[
		{
			"data":"1","label":"Left Feed"
		},{
			"data":"2","label":"Left Discharge"
		},{
			"data":"3","label":"Right Feed"
		},{
			"data":"4","label":"Right Discharge"
		}
	]
}
			

All ellipse type

Don't have
		

All ellipse type (Never change).

Sample Response

Status: 200 OK
Content Type: application/json;charset=UTF-8
				
			
			{
				"code":"0",
				"message":"success",
				"unit":[
					{
						"data":"3",
						"label":"95% exclu."
					},{
						"data":"2",
						"label":"95% inclu."
					},{
						"data":"1",
						"label":"Best Fit"
					}
				]
			}
			

Create a machine vibration test

POST  /setMachineEntry.php

Create a machine vibration test.

Request attributes

id_machine_brand int(11) ID of machine brand
id_machine_model int(11) ID of machine model
machine_year int(11) Year of the machine
id_application int(11) ID of the application
cut_size_1 double Value of cut size 1
cut_size_2 double Value of cut size 2
cut_size_3 double Value of cut size 3
cut_size_4 double Value of cut size 4
project_name string [255] Name of Project
customer string [255] Name of customer
location string [255] Location of test
GPS_long double GPS longitude
GPS_lat double GPS latitude
id_screen_media_used_1 int(11) ID of screen Media
screen_media_used_opening_1 double Opnening of screen media used
screen_media_used_wire_diameter_1 double Wire diameter of screen Media
screen_media_used_detail_1 string [255] Detail of screen media used
id_screen_media_used_2 int(11) ID of screen Media
screen_media_used_opening_2 double Opnening of screen media used
screen_media_used_wire_diameter_2 double Wire diameter of screen Media
screen_media_used_detail_2 string [255] Detail of screen media used
id_screen_media_used_3 int(11) ID of screen Media
screen_media_used_opening_3 double Opnening of screen media used
screen_media_used_wire_diameter_3 double Wire diameter of screen Media
screen_media_used_detail_3 string [255] Detail of screen media used
id_screen_media_used_4 int(11) ID of screen Media
screen_media_used_opening_4 double Opnening of screen media used
screen_media_used_wire_diameter_4 double Wire diameter of screen Media
screen_media_used_detail_4 string [255] Detail of screen media used
comment string Comment
id_unit_choice int(11) ID of unit (1 or 2)
app string [30] IOS ou Android
app_version string [20] Numéro de la version
chip_mac string [20] Adresse Mac de la puce utilisée

Sample Request

{
    't': '8a81f5f66c973285e17d89026d31d47c',
   'id_machine_brand': '1',
   'id_machine_model': '2',
   'machine_year': '2009',
   'id_application': '3',
   'cut_size_1': '1',
   'cut_size_2': '1',
   'cut_size_3': '1',
   'cut_size_4': '1',
   'project_name': 'SMS Minerals',
   'customer': 'Customer 2',
   'location': 'South america',
   'GPS_long': -8.7831897,
   'GPS_lat': -55.493671,
   'id_screen_media_used_1': '1',
   'screen_media_used_opening_1': 1.1,
   'screen_media_used_wire_diameter_1': 1.11,
   'screen_media_used_detail_1': 'Detail of screen',
   'id_screen_media_used_2': '2',
   'screen_media_used_opening_2': 2.2,
   'screen_media_used_wire_diameter_2': 2.22,
   'screen_media_used_detail_2': 'Detail of screen',
   'id_screen_media_used_3': '3',
   'screen_media_used_opening_3': 3.3,
   'screen_media_used_wire_diameter_3': 3.33,
   'screen_media_used_detail_3': 'Detail of screen',
   'id_screen_media_used_4': '4',
   'screen_media_used_opening_4': 4.4,
   'screen_media_used_wire_diameter_4': 4.44,
   'screen_media_used_detail_4': 'Detail of screen',
   'comment': 'Somme comment',
   'id_unit_choice': '2',
   'app': 'IOS',
   'app_version': '0.8.1',
   'chip_mac': 'xx:xx:xx:xx'
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'id_entry': '123'
}

Create a machine vibration side

POST  /setMachineEntrySide.php

Create a machine vibration test side for a machine vibration test.

Request attributes

id_entry int(11) ID of machine vibration test
id_side int(11) ID of machine side (1 for Left Feed , 2 for Left Discharge, 3 for Right Feed and 4 Right Discharge)
date_beginning Datetime [yyyy-MM-dd hh-mm-ss] Date of test start
sample_frequency double Frequency of sample
vibrating_frequency double Frequency vibrating
RPMs int(11) RPM s
acceleration_x_y double Acceleration x y
acceleration_x_min double Acceleration x minimum
acceleration_x_max double Acceleration x max
acceleration_y_min double Acceleration y minimum
acceleration_y_max double Acceleration y max
acceleration_z_min double Acceleration z minimum
acceleration_z_max double Acceleration z max
stroke_x_y double Stroke x y
stroke_x double Stroke x
stroke_y double Stroke y
stroke_z double Stroke z
angle double Angle
axis_map_x string [3] Original MetaWear Axis x
axis_map_y string [3] Original MetaWear Axis y
axis_map_z string [3] Original MetaWear Axis z

Sample Request

{
   't': '8a81f5f66c973285e17d89026d31d47c',
   'id_entry': '1',
   'id_side': '2',
   'date_beginning': '2017-10-27 14:25:32',
   'sample_frequency': 792.1,
   'vibrating_frequency': 13.9,
   'RPMs': 835,
   'acceleration_x_y': 9.98,
   'acceleration_x_min': 7.6,
   'acceleration_x_max': -7.7,
   'acceleration_y_min': 5.6,
   'acceleration_y_max': -7.3,
   'acceleration_z_min': 3.1,
   'acceleration_z_max': -2.4,
   'stroke_x_y': 25.6,
   'stroke_x': 19.6,
   'stroke_y': 16.5,
   'stroke_z': 3.4,
   'angle': 1.07,
   'axis_map_x': '-x',
   'axis_map_y': 'y',
   'axis_map_z': 'z'
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'id_entry_side': '123'
}

Create all machine vibration side data

POST  /setMachineEntrySideData.php

Create all machine vibration test side data for a machine vibration test side.

Request attributes

id_entry_side string ID of machine vibration test side
elapsed string elapsed
y_axis double y_axis
x_axis double x_axis
z_axis double z_axis
fft_freq double Frequency vibrating
fft_magnitude double fft_magnitude

Sample Request

{
  't': '8a81f5f66c973285e17d89026d31d47c',
  'id_entry_side': '1',
  'data':[
  {
   'elapsed': 0,
   'y_axis': -1.819335938,
   'x_axis': -1.956054688,
   'z_axis': 0.031738281,
   'fft_freq': 0,
   'fft_magnitude': 9.445800781
  },
  {
   'elapsed': 0.001464844,
   'y_axis': -1.138671875,
   'x_axis': -2.140625,
   'z_axis': -0.323730469,
   'fft_freq': 0.19673391,
   'fft_magnitude': 27.89292844
  },
  {
   'elapsed': 0.004394531,
   'y_axis': -0.381347656,
   'x_axis': -2.637207031,
   'z_axis': 0.131347656,
   'fft_freq': 0.393467819,
   'fft_magnitude': 27.742993
  }
  ]
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'nb_entry_side_data': '123'
}

Create all machine vibration side ellipse

POST  /setMachineEntrySideEllipse.php

Create all machine vibration test side ellipse for a machine vibration test side.

Request attributes

id_entry_side string ID of machine vibration test side
id_fit string ID of ellipse type
center_x_axis double X0: center point x-axis
center_y_axis double Y0: center point y-axis
rotation double Phi: rotation of ellipse
length_major_axis double Major: Length of major axis
length_minor_axis double Minor: Length of minor axis

Sample Request

{
  't': '8a81f5f66c973285e17d89026d31d47c',
  'id_entry_side': '1',
  'data':[
  {
   'id_fit': 1,
   'center_x_axis': -1.819335938,
   'center_y_axis': -1.956054688,
   'rotation': 0.031738281,
   'length_major_axis': 0,
   'length_minor_axis': 9.445800781
  },
  {
   'id_fit': 2,
   'center_x_axis': -1.138671875,
   'center_y_axis': -2.140625,
   'rotation': -0.323730469,
   'length_major_axis': 0.19673391,
   'length_minor_axis': 27.89292844
  },
  {
   'id_fit': 3,
   'center_x_axis': -0.381347656,
   'center_y_axis': -2.637207031,
   'rotation': 0.131347656,
   'length_major_axis': 0.393467819,
   'length_minor_axis': 27.742993
  }
  ]
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'nb_entry_side_ellipse': '3'
}

Create a machine vibration inclination

POST  /setMachineEntryInclination.php

Create a machine vibration test side for a machine vibration test.

Request attributes

id_entry int(11) ID of machine vibration test
desk_inclination double Inclination of desk

Sample Request

{
   't': '8a81f5f66c973285e17d89026d31d47c',
   'id_entry': '1',
   'desk_inclination': 13.9
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'id_entry_inclination': '123'
}

Create all machine vibration inclination data

POST  /setMachineEntryInclinationData.php

Create all machine vibration test Inclination data for a machine vibration test Inclination.

Request attributes

id_entry_inclination string ID of machine vibration test Inclination
elapsed string elapsed
acc_x double acc_x
acc_y double acc_y
acc_z double acc_z

Sample Request

{
  't': '8a81f5f66c973285e17d89026d31d47c',
  'id_entry_inclination': '1',
  'data':[
  {
   'elapsed': 0,
   'acc_x': -1.819335938,
   'acc_y': -1.956054688,
   'acc_z': 0.031738281
  },
  {
   'elapsed': 0.001464844,
   'acc_x': -1.138671875,
   'acc_y': -2.140625,
   'acc_z': -0.323730469
  },
  {
   'elapsed': 0.004394531,
   'acc_x': -0.381347656,
   'acc_y': -2.637207031,
   'acc_z': 0.131347656
  }
  ]
}

Sample Response

Status: 201 Created
Content Type: application/json;charset=UTF-8
{
   'code': 200,
   'message': 'success',
   'nb_entry_inclinatione_data': '123'
}