Problem With Example #4 (create stations) - 401 error?

Problem With Example #4 (create stations) - 401 error?

by Vesna Vidmar -
Number of replies: 3

Hi,

I have been going over all the webinars - thank you very much for recording them. I learned a lot.

I took the code that Timo has developed for Example #4 (thank you, Timo) and made necessary adjustments. 

I took the excel file and filled data for a few example stations in Slovenia. I followed all the steps & generated token inside my OSCARdepl Management tab. Code generates XML file & writes it to disk.

When it is time to upload it, I get 401 error (look picture in attachment). I did not find any documentation regarding errors, so I do not know how to fix this problem. We plan to upload over 90 stations, so we need API upload.

Thank you for your reply and ideas on how to fix this issue.

Regards,


Vesna

VesnaAPI should upload XML file (I have provided my token), but for some reason I get 401 error. How can I fix this?


In reply to Vesna Vidmar

Re: Problem With Example #4 (create stations) - 401 error?

by Vesna Vidmar -
Nobody has joined the discussion.
I managed to solve this problem, so I wish to give advice to anyone, that will have same problem as me - 401 ERROR means you have problem with your token and/or your credentials.
You need to double check token or second possible solution is to revoke token & generate new token.

Regards,
Vesna
In reply to Vesna Vidmar

Re: Problem With Example #4 (create stations) - 401 error?

by Timo Proescholdt -
Dear Vesna,

thank you for sharing this information. I was just going to answer, but you are right, the 401 error is given when the API Token is not correct.
All National Focal Points can login to OSCAR/Surface and generate a token in the management console.

with kind regards,
Timo
In reply to Timo Proescholdt

Re: Problem With Example #4 (create stations) - 401 error?

by Vesna Vidmar -

Thank you for your reply Timo & confirmation.

I would like to share another of my observation - OSCAR Demo is reset on every Monday - that means all stations are re-set & also that all tokens in DEMO version are revoked too. This week I generated new one.

Regards,

Vesna