Linkedin Company Data

부분 유료
분류별 William Barber | 업데이트됨 15 giorni fa | Social
인기

9.8 / 10

지연 시간

3,021ms

서비스 수준

95%

Health Check

100%

모든 토론으로 돌아가기

Bad Request: There was an error parsing the input (400)

Rapid account: Luke Wilson Storm
LukeWilsonStorm
3 mesi fa

I’m using the code as given to look up company data, but I’m getting an error if I use it anywhere except on this page to test the endpoint.

What am I doing wrong?

This is the result I get:

{"message":"Bad Request: There was an error parsing the input","status_code":400}

const url = 'https://linkedin-company-data.p.rapidapi.com/linkedInCompanyDataJson';
const options = {
	method: 'POST',
	headers: {
		'content-type': 'application/json',
		'X-RapidAPI-Key': 'API_KEY',
		'X-RapidAPI-Host': 'linkedin-company-data.p.rapidapi.com'
	},
	body: {
		liUrls: [
	'https://www.linkedin.com/company/hilton/'
		]
	}
};

try {
	const response = await fetch(url, options);
	const result = await response.text();
	console.log(result);
} catch (error) {
	console.error(error);
}
Rapid account: Luke Wilson Storm
LukeWilsonStorm Commented 3 mesi fa

Could be useful to have something on the “Tutorials” page maybe, as there’s nothing there currently.

Rapid account: Williambarberjr
williambarberjr Commented 3 mesi fa

Yeah, thanks for the heads up, that’s good to know. I don’t think I have the ability to change that code as it’s auto generated by the platform unfortunately but I’ll look into it.

Rapid account: Luke Wilson Storm
LukeWilsonStorm Commented 3 mesi fa

Thanks that worked!

But FYI, that isn’t included or mentioned in the code you can copy from here

Rapid account: Williambarberjr
williambarberjr Commented 3 mesi fa

You forgot JSON.stringify() around the body:

JSON.stringify({
liUrls: [
https://www.linkedin.com/company/hilton/
]
})

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입