Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi All,

I'm facing a peculiar problem while accessing user details using Yammer REST API.

I'm using the following endpoint to access the user details

https://api.yammer.com/api/v1/oauth/tokens.json?user_id=USERNAME&consumer_key=CONSUMERTOKEN

The problem is when the user name does not contains a period "." (like johns) the API is working fine and not giving any error, but when the user name contains a period (john.s) the API is giving error HTTP 400 bad request.

I'm sending the request like

https://api.yammer.com/api/v1/oauth/tokens.json?user_id=john.s&consumer_key=CONSUMERTOKEN

Am I missing something. I'm using postman to test the API and also tried with C# code to get the result, but ended with a same problem (HTTP 400 Bad request).

What I have tried:

I've used postman to test the API endpoint. Everything is fine when the user name does not contains a period (".") but when the user name contains period (".") the endpoint response is HTTP 400 Bad Request
Posted
Updated 24-Aug-17 12:46pm

This question should be brought up with Yammer, not some 3rd party website that doesn't support it.
 
Share this answer
 
Quote:
I'm sending the request like

https://api.yammer.com/api/v1/oauth/tokens.json?user_id=john.s&consumer_key=CONSUMERTOKEN

You need to URL encode your QueryString. Please read this: WebUtility.UrlEncode Method (String) (System.Net)[^]

UPDATE: Looking at the Yammer API documentation, OAuth 1.0a is not supported. You need to use OAuth 2.0. REF: OAuth 2: Server & Client-Side Flow · Yammer Developer Site[^]

Quote:
https://www.yammer.com/oauth2/authorize?client_id=[:client_id]&response_type=code&redirect_uri=[:redirect_uri][^]
 
Share this answer
 
v4
Comments
Amlan Sengupta 25-Aug-17 4:57am    
Already done that...without any result
Graeme_Grant 25-Aug-17 5:04am    
we have no idea as you have posted no code... The URL samples above say otherwise...
Amlan Sengupta 25-Aug-17 5:06am    
I'm using POSTMAN to check the endpoint
Graeme_Grant 25-Aug-17 5:30am    
Again, we can't see what you are seeing. HTTP 400 Bad request - this is saying that there is an error with your call. If you are using POSTMAN, or Fiddler for that matter, then what does the inner error response say? Normally returned in the body...
Amlan Sengupta 25-Aug-17 5:39am    
In the reply body I'm getting the following text
Unexpected ''

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900