Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access_token on Bitrix instance not working (always 401) #55

Open
mruniverse opened this issue Sep 20, 2023 · 3 comments
Open

access_token on Bitrix instance not working (always 401) #55

mruniverse opened this issue Sep 20, 2023 · 3 comments

Comments

@mruniverse
Copy link

I've already tested in other versions and it works fine.

@mrhyde
Copy link
Member

mrhyde commented Sep 20, 2023

Hi! Do you mean other versions of this library or some other packages?
Can you provide an example that leads to an error? Be careful not to expose you access_token

@mruniverse
Copy link
Author

Other versions of this library. Sure! i'm going to prepare an example in just a moment.

@foresh9
Copy link

foresh9 commented Oct 27, 2023

I have the same problem.
Always returns Response code 401 (Unauthorized)
The token is definitely valid, because if you use the Bitrix API, there is no such error.

  import { Bitrix } from '@2bad/bitrix'

  const access_token = "7fe33a650068085800680852000000010000";
  const bitrix_service = Bitrix('https://b24-6.bitrix24.ru/rest', access_token)
   
bitrix_service.deals
    .get("1")
    .then(({ result }) => {
const { TITLE } = result; 
      console.log(TITLE);
    })
    .catch(console.error);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants