putdotio / putio-js

JavaScript SDK for interacting with the put.io API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PutioAPI.Files.Upload 401 but PutioAPI.Account.Info() works

ptheofan opened this issue · comments

commented

Hi, I do not understand what I am doing wrong. I initialize the API client like this

      const putioConfig = this.configService.get('putio');
      this.api = new PutioAPI({
        clientID: putioConfig.clientId,
      });
      this.api.setToken(putioConfig.oAuthToken);

with this API when I call the Account.Info() it works perfectly as expected.

  const accountInfo = await putio.Account.Info();
  this.logger.log(`Uploading as ${accountInfo.data.info.username}`);

However when I call the Files.Upload(...) I get 401

      await api.Files.Upload({
        file: absolutePath,
        fileName: filename,
        parentId: targetFolderId,
      });

is there some issue with the sdk or am I doing something wrong?

commented

hey @ptheofan it's on me... 😞 working on a fix now!

commented

should be fixed in v8.35.1