C
C
ChaoticEvil2015-06-23 10:40:56
API
ChaoticEvil, 2015-06-23 10:40:56

How to initialize FAPI?

Good day to all.
You need to work on the client (use some widgets) with the classmates API. For this, an application was created (External and WEB [HTML]), the user was oAuth-authorized on the server, but when trying to initialize FAPI (as indicated in the documentation [ http://apiok.ru/wiki/display/api/FAPI.init +en]):

<script type="text/javascript" src="//api.odnoklassniki.ru/js/fapi5.js"></script>

<script type="text/javascript">
var rParams = FAPI.Util.getRequestParameters();
FAPI.init(rParams["api_server"], rParams["apiconnection"],
          function() {
              alert("Инициализация прошла успешно");
          },
          function(error) {
              alert("Ошибка инициализации");
          }
);
</script>

in the browser console (firefox 38) I get an error:
TypeError: this.webServerUrl is undefined fapi5.js:1:744

The question is what am I doing wrong? What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vjacheslav Kanivetc, 2015-06-25
@ChaoticEvil

FAPI is not intended for OAUTH applications and does not work if the application is not launched from the Odnoklassniki platform. For external sites, use the REST API.

A
Alexander, 2015-06-24
@liff

You are doing everything right. This is a bug in the fapi5.js file, so this bug is not on your side. Wait a bit, their either will be updated (cdn will go bad), it will be normal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question