Welcome to our peer-to-peer forums, where owners help owners. Need help now? Visit eSupport here.

English Community

Special Interest DiscussionsGeneral Discussion
All Forum Topics
Options

35 Posts

04-08-2008

United States of America

86 Signins

210 Page Views

  • Posts: 35
  • Registered: ‎04-08-2008
  • Location: United States of America
  • Views: 210
  • Message 1 of 9

Support / Warranty API lookups - have my token

2018-07-26, 20:10 PM

I'm trying to setup a script to check the warranty API for machines.  I received my token from my account rep.  Not sure if my coding is wrong, or if the token isn't working or. . .  Was hoping someone else that might be doing this could let me know if what I'm doing looks right.

 

Basically just trying with curl to get started.  Code below. 

 

curl -i http://supportapi.lenovo.com/v2.5/warranty?serial=[serial] -H "Authorization: Bearer [token]"

 

I get an HTTP/1.1 401 Unauthorized

{"Message":"Authorization has been denied for this request."}

 

Lots more in the response back, but nothing I think is helpful.

Reply
Answer
Options

10437 Posts

09-04-2014

Slovakia

32831 Signins

1220100 Page Views

  • Posts: 10437
  • Registered: ‎09-04-2014
  • Location: Slovakia
  • Views: 1220100

Re: Support / Warranty API lookups - have my token

2018-08-02, 17:30 PM

Apologies, seems the correct term is ClientID and not Client ID as previously informed. Please  give that a try and let us know whether or not it works now.

 

Andy

 

English Community Administrator
Lenovo eServices

Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points 
Did you find a post helpfull? You can thank the member by awarding them a Thumbs Up
 

Please don't ask me questions by Personal Message; questions belong in the forums.


Using Browser Search to find your answers in Lenovo and Moto Community
Reply

Replies(8)
Options

10437 Posts

09-04-2014

Slovakia

32831 Signins

1220100 Page Views

  • Posts: 10437
  • Registered: ‎09-04-2014
  • Location: Slovakia
  • Views: 1220100
  • Message 2 of 9

Re: Support / Warranty API lookups - have my token

2018-07-31, 5:11 AM

Hello,

 

Thanks for pointing this out. I've been informed as follows:

 

The Header should not be

-H "Authorization: Bearer [token]"

 

Instead it should be

-H “Client ID: [token]”

 

The relevant team has been asked to check and update any documentation as required.

 

Thanks again.

 

Andy

 

English Community Administrator
Lenovo eServices

Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points 
Did you find a post helpfull? You can thank the member by awarding them a Thumbs Up
 

Please don't ask me questions by Personal Message; questions belong in the forums.


Using Browser Search to find your answers in Lenovo and Moto Community
Reply
Options

35 Posts

04-08-2008

United States of America

86 Signins

210 Page Views

  • Posts: 35
  • Registered: ‎04-08-2008
  • Location: United States of America
  • Views: 210
  • Message 3 of 9

Re: Support / Warranty API lookups - have my token

2018-07-31, 11:30 AM

Don't think that's it.  Before I was receiving a message saying, "Authorization has been denied for this request."

 

Now changing over to Client ID, I get -

 

Bad Request - Invalid Header
HTTP Error 400. The request has an invalid header name.

Reply
Answer
Options

10437 Posts

09-04-2014

Slovakia

32831 Signins

1220100 Page Views

  • Posts: 10437
  • Registered: ‎09-04-2014
  • Location: Slovakia
  • Views: 1220100
  • Message 4 of 9

Re: Support / Warranty API lookups - have my token

2018-08-02, 17:30 PM

Apologies, seems the correct term is ClientID and not Client ID as previously informed. Please  give that a try and let us know whether or not it works now.

 

Andy

 

English Community Administrator
Lenovo eServices

Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points 
Did you find a post helpfull? You can thank the member by awarding them a Thumbs Up
 

Please don't ask me questions by Personal Message; questions belong in the forums.


Using Browser Search to find your answers in Lenovo and Moto Community

0 person found this solution to be helpful.

This helped me too

Reply
Options

35 Posts

04-08-2008

United States of America

86 Signins

210 Page Views

  • Posts: 35
  • Registered: ‎04-08-2008
  • Location: United States of America
  • Views: 210
  • Message 5 of 9

Re: Support / Warranty API lookups - have my token

2018-08-02, 18:00 PM

That's the fix!  Thanks so much for your help!  They definitely need to work on that documentation a bit.  Even having ONE working example in there would be a huge improvement.

Reply
Options

3 Posts

08-02-2018

United States of America

1 Signins

44 Page Views

  • Posts: 3
  • Registered: ‎08-02-2018
  • Location: United States of America
  • Views: 44
  • Message 6 of 9

Re: Support / Warranty API lookups - have my token

2018-08-02, 18:24 PM

Could anyone here please give me an example to use powershell access warranty API? I have below code but not working: 

 

Invoke-WebRequest -uri  http://supportapi.lenovo.com/v2.5/warranty?serial=[serial] -H “ClientID:XXXXXXX”

 

Thanks in advance!

 

Claudia

 

Admin note: serial number edited to avoid possible abuse

Reply
Options

35 Posts

04-08-2008

United States of America

86 Signins

210 Page Views

  • Posts: 35
  • Registered: ‎04-08-2008
  • Location: United States of America
  • Views: 210
  • Message 7 of 9

Re: Support / Warranty API lookups - have my token

2018-08-02, 18:30 PM

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("ClientID", 'your token here')

 

Invoke-RestMethod http://supportapi.lenovo.com/v2.5/warranty?serial=yourserialhere -ContentType "application/JSON" -Headers $headers

Reply
Options

3 Posts

08-02-2018

United States of America

1 Signins

44 Page Views

  • Posts: 3
  • Registered: ‎08-02-2018
  • Location: United States of America
  • Views: 44
  • Message 8 of 9

Re: Support / Warranty API lookups - have my token

2018-08-02, 18:36 PM

Thank you so much! it works for me now,  you save my day! Appreciate!

 

Claudia

Reply
Options

1 Posts

01-22-2021

Canada

2 Signins

5 Page Views

  • Posts: 1
  • Registered: ‎01-22-2021
  • Location: Canada
  • Views: 5
  • Message 9 of 9

Re:Support / Warranty API lookups - have my token

2021-01-22, 21:27 PM

Did Lenovo take down their public warranty API this week? do i now require a token to make warranty requests? and how do I go about it?

Reply
Forum Home

Community Guidelines

Please review our Guidelines before posting.

Learn More

Check out current deals!

Go Shop
X

Save

X

Delete

X

No, I don’t want to share ideas Yes, I agree to these terms