MyWiFi

API Developer's guide

Thanks to the API My Wi-Fi Service, developers can interface their applications / websites with the services offered by our platform. The API can be used for example to get a list of users, the list of groups, to add, delete or edit users and much more.

Complete list of available APIs

Technologies used

The authentication protocol used is OAuth 2 with the mode 3-legged OAuth, while calls to services occur in mode REST.
The exchange of data to and from the service is exposed using JSON and XML formats and the character set utf-8.

Data formats

  • Money : We use the symbol "." as a decimal. Examples of valid formats are: 10.5 , 0.5 , 35.0 , 35
  • Date and time : API uses ISO 8601 format. UTC date are written with the Z at the end.
    Examples :
    2012-07-27T18:51:45.53403Z // UTC
    2012-07-27T11:51:45.53403-07:00 // Local

Registering your application

To use the services, the developer will have to make a registration by sending an email to info@softvision.it with the following data :

  • First name, Last name / company.
  • Login used to access the application My Wi-Fi Service.
In response, the developer will receive two entries ( client_id and client_secret ) to be used in the authentication procedure OAuth2.

Using APIs

We analyze in more detail how to use the API My Wi-Fi Service.
Your application must first obtain a token (alphanumeric string) from our server. This token, which is valid for 24 hours, must then be added to each subsequent request for API call.
To get the token you need to make a call to our servers using OAuth2.
The parameters that you will need are as follows:

  • client_id and client_sectret (supplied by Softvision after the registration of the application)
  • Authorization end point : https://app.mywifiservice.com/OAuth/Authorize
  • Token end point : https://app.mywifiservice.com/OAuth/Token
  • Scope : represents the privileges required by the application. Can take the values ​​'READ', 'WRITE' or 'READ WRITE'
  • Return url : is the url to which you are redirected after the request for entering your login credentials. Generally corresponds to the main page of your application/website.

The flow of operations is roughly as follows:
1) The application makes a call all'Authorization endpoint. You are prompted to enter your credentials to access to My Wi-Fi Service.
When you are finished you will be redirected back to the url of your application.
2) The application requires the token with a call to the token endpoint.
3) The application receives the Token and Refresh Token. The first can be used for 24 hours at the end of which it is possible to repeat procedures 1) and 2) to get a new token or you can use the Refresh Token to renew the expiry of the original Token.

Once you have received the token, you can make calls to the API by making requests REST at api.mywifiservice.com .
See for example a call to get the list of users of your My Wi-Fi Service account.

Request

GET https://api.mywifiservice.com/v1/registeredusers HTTP/1.1
Accept: application/json
Content-type: application/json
Accept-Charset: UTF-8
Authorization: Bearer TOKEN


Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 753
Date: Sat, 28 Apr 2012 13:19:40 GMT

[{"RegisteredUserID":14646,"FirstName":"Mirko","LastName":"De Santis","Login":"343412434","Password":"afr454tgfgf","GroupID":3,"StateInfo":196,"WeeklyRatePlanID":3, "Address":"","City":"Roma","Province":"","ZIPCode":"67051","DocumentIssuedBy":null,"BornDate":"2012-03-02T00:00:00","RegistrationDate":null, "DocumentIssuedDate":"2012-03-02T00:00:00","DocumentNumber":null,"Telephone":"3444442423","EMail":"","MobilePhone":null,"Note":null,"DocumentTypeID":-1, "Balance":5.6895,"UserType":0,"IsoCountryCode":"IT","NavigationModeCode":1,"MacAddress":"AC-08-E0-DE-F2-C7", "RegisteredBySMS":false,"Disabled":false,"Sold":false,"AccountWithExpiration":false,"AccountExpiration":null,"TicketExpirationDate":null},
{"RegisteredUserID":14649,"FirstName":"1 ora","LastName":null,"Login":"104032500","Password":"8795462A791E0D9BE95D966ED69354AA","GroupID":3, "StateInfo":208,"WeeklyRatePlanID":3,"Address":null,"City":null,"Province":null,"ZIPCode":null,"DocumentIssuedBy":null, "BornDate":null,"RegistrationDate":null,"DocumentIssuedDate":null,"DocumentNumber":null,"Telephone":null,"EMail":null,"MobilePhone":null, "Note":null,"DocumentTypeID":null,"Balance":0.0000,"UserType":1,"IsoCountryCode":null,"NavigationModeCode":4,"MacAddress":"00-13-CE-80-4A-FF",
"RegisteredBySMS":false,"Disabled":false,"Sold":false,"AccountWithExpiration":false,"AccountExpiration":null,"TicketExpirationDate":null}, {"RegisteredUserID":14650...........
................
................
...............}]

Complete list of available APIs



ASP.Net and PHP examples

There are two complete examples (Asp.net and PHP) that show how to authenticate OAuth 2 and how to make API calls:

api php examples
PHP Client Example

api asp.net examples
ASP.Net Client Example