bitrix
bitrix copied to clipboard
access_token on Bitrix instance not working (always 401)
I've already tested in other versions and it works fine.
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
Other versions of this library. Sure! i'm going to prepare an example in just a moment.
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);