Post

1 follower Follow
0
Avatar

Invalid username in REST API

I am attempting to login to Clarizen via the REST API using Java. I am able to make a call to getServerDefinition to get the server location that I need, I then send the same credentials to the login address and I get a 401 error with error code "LoginFailure" and message "Invalid username". These are the same credentials I use to login to Clarizen normally, is there something I'm missing?

Shawn Fortin Answered

Please sign in to leave a comment.

2 comments

0
Avatar

My best guess as to potential issues in my code is encoding. Should I be URL encoding my request? If so, what would be the recommended way to do that in java? I am currently doing it as follows:

URLEncoder.encode(request, "UTF-8");

Shawn Fortin 0 votes
Comment actions Permalink
1
Avatar

Removing the URL encoding allowed it to work. I had also forgot to include quotation marks in my JSON in my request body, don't let that trip you up!

Shawn Fortin 1 vote
Comment actions Permalink