OPAPI (Operator API) is the name of the API that Bredbandskollen uses with the operators that we are currently exchanging information with each time a user performs a measurement.
The aim of the OPAPI is to improve the user experience by giving the user more information about their results, but also to collect better data for statistics. The user doesn't have to specify the connection when we can get this information directly from the operator during, or shortly after, an ongoing measurement.
Also, the operators get their user's measurements directly reported to them, regardless of whether any subscription can be identified or not. Each operator can then use those measurement results to improve their support and/or to compile their own statistics. They could, for instance, provide a better user experience for both support staff and end-users by linking the ip number saved with the measurement of a user having that same ip number at the time the measurement was performed. This enables staff at the operator's support desk to see all measurements performed by the user on their display, at the same time they are talking to them.
How does it work?
When the Web page that contains the test engine has loaded into the browser, it downloads a number of settings from a server-generated settings file. As far as the OPAPI is concerned, there are two variables of importance here:
The user's operator: the settings file collects this information about the user's operator via ip adress and the GeoIP from Maxmind. This is done on the server side.
The user's user id [cookie]: If the user has carried out measurements in the past we have already saved a cookie with a unique user id. This cookie brings together all the measurements made on the same physical drive. You could say that measurements share the same cookie.
When the loading of the settings file is complete, it sends an initializing call to the current operator. This call also sends information about which function in the test engine should be run as soon as the initializing code is done executing at the operator's end. If the operator has the possibility to return all information about your subscription to the Web client, it will be done here. If this happens this information will be saved with the client and presented in the interface as soon as the measurement is done.
Some operators can directly respond to what connection the user has, others deliver this later in the flow of execution
In parallel with this, a measurement can be running. As soon as the measurement is complete the result is stored in the database. When the function that saves the result in the database is complete a second call to the OPAPI is run, and the result is saved at the operator's end. At the same, we start a timer that waits 3 seconds for a response from this second call. If this response is not received within the time limit, Bredbandskollen will ignore any subsequent response from the OPAPI. However, if the OPAPI responds before the time limit expires, we update the measurement result with returned information about the subscription. Then we update the Web page.
If the OPAPI is able to deliver information about the user's connection we remove the ability to set this by hiding the button "Change Connection".