如何获得针对api的部门(完全在线)

时间:2018-11-13 16:06:40

标签: exact-online

我想知道如何将大多数api调用所需的division获取到确切的在线平台。

文档还建议我使用api/v1/current/Me作为第一个电话,但是在运行此电话时,我收到以下消息(没用):

array(3) { ["url"]=> string(46) "https://start.exactonline.be/api/v1/current/Me" ["request"]=> array(0) { } ["response"]=> NULL }

1 个答案:

答案 0 :(得分:0)

当您在Exact Online中切换公司时,浏览器的URL将显示新选择的公司的部门:

// convert a text document into a sentences array and a token array for each sentence
function text2SentencesTokens(text, tokenP) {
  var self = this;
  return new Promise((resolve, _) => {
    let sentences = text.split(/\n+/g);
    let sentencesP = sentences.map((sentence, lineIndex) => { // for each sentence
      return new Promise((resolve, _) => {
        let tokens = sentence.replace(/[\\+;:\?!\»\«\>\<\]\[\)\(,\.\‘'“”"]/g, '').split(/\s+/g);
        let tokensP = tokens.map((token, tokenIndex) => { // for each token
          let item = {
            "index": (tokenIndex + 1),
            "word": token
          }
          var escaped = token.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
          var wordRegex = RegExp("\\b(" + escaped + ")\\b", "g");
          var match = null;
          while ((match = wordRegex.exec(text)) !== null) {
            var wordStart = match.index;
            var wordEnd = wordStart + token.length - 1;
            item.characterOffsetBegin = wordStart;
            item.characterOffsetEnd = wordEnd;
          }

          if (typeof(tokenP) == 'function') {
            return tokenP.apply(self, [item, sentence]);
          } else {
            return new Promise((resolve, _) => {
              resolve(item);
            });
          }
        });
        Promise.all(tokensP)
          .then(res => {
            resolve({
              index: lineIndex,
              text: sentence,
              tokens: res
            });
          })
          .catch(err => console.error(err))
      });
    });
    Promise.all(sentencesP)
      .then(res => {
        resolve({
          sentences: res
        })
      })
      .catch(err => console.error(err))
  });
} //text2SentencesTokens

text = "Steve down walks warily down the street down\nWith the brim pulled way down low";
text2SentencesTokens(text)
  .then(res => console.log(JSON.stringify(res, null, 2)))

您还可以查询系统/部门或在https://online-sql-editor.com(我在那工作)上运行以下查询:

https://start.exactonline.nl/docs/MenuPortal.aspx?_Division_=123123