Skip to content

BUG with get knowledgeArticles #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jinnguyen opened this issue Mar 21, 2018 · 3 comments
Open

BUG with get knowledgeArticles #66

jinnguyen opened this issue Mar 21, 2018 · 3 comments

Comments

@jinnguyen
Copy link

Hello,

I tried with /services/data/v40.0/support/knowledgeArticles via force-rest-api v40.0 and I get this issue:
[{"errorCode":"MISSING_ARGUMENT","message":"Language has to be specified in HTTP header."}]

I search in Google and I know how to fix it: we need add header:
Accept-language: en-US,en;q=0.9,vi;q=0.8

Document: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_knowledge_support_artlist.htm

I need its go to maven, b/c i include this client to my project via maven. Could u pls review and fix it and release to maven 0.0.41 ? tks!

@jesperfj
Copy link
Owner

Which method in ForceApi are you using? getSObject or get()? It would be great if you can send a pull request with a proposed fix that includes a test.

@jinnguyen
Copy link
Author

Hi, im using method get(), and seem like other method get same issue.

Actually it just need add 1 more header:
header("Accept-language", "en-US,en;q=0.9,vi;q=0.8")
like this:

return new ResourceRepresentation(this.apiRequest((new HttpRequest()).url(this.uriBase() + path).method("GET").header("Accept", "application/json").header("Accept-language", "en-US,en;q=0.9,vi;q=0.8")), this.jsonMapper);

@jinnguyen
Copy link
Author

Btw, I think the best way is: the api should allow add headers to request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants