Recent searches
No recent searches
403 error when voting from ViewArticleActivity
Posted Sep 02, 2022
Hello, everyone!
I initialized Android Support SDK for using Help Center. In general it works fine except of a one problem. When I try to vote for article the button blinks and the vote is not registered in statistics.
I checked logs of application and saw there:
I/okhttp.OkHttpClient: --> POST https://<my_subdomain>.zendesk.com/api/v2/help_center/articles/<article_id>/up.json (4-byte body)
I/okhttp.OkHttpClient: <-- 403 https://<my_subdomain>.zendesk.com/api/v2/help_center/articles/<article_id>/up.json (166ms, unknown-length body)
Anonymous voting is enabled in our Zendesk Admin Panel according to this article
Why does not voting work and API return 403 error?
For more information:
I initialize Zendesk SDK in this way:
Logger.setLoggable(true)
Zendesk.INSTANCE.init(
this,
"https://<my_subdomain>.zendesk.com",
"<application_id>",
"<oauth_client_id>"
)
Zendesk.INSTANCE.setIdentity(AnonymousIdentity())
Support.INSTANCE.init(Zendesk.INSTANCE)
and open Help Center:
HelpCenterActivity.builder()
.withContactUsButtonVisible(false)
.withShowConversationsMenuButton(false)
.withArticlesForSectionIds(sectionId)
.show(context)
I will appreciate for any help!
1
7
7 comments
Andrey Filatov
I checked the support demo app and anonymous voting worked there (with my credentials).
I noticed that demo app uses old version of Support SDK 5.0.3 (last version is 5.1.0). When I changed the version of SDK to 5.0.3 in my application anonymous voting started working.
After some experiments I have known that anonymous voting has not been working since version 5.0.6 for my case (5.0.5 works).
I suggest that it's a bug of new versions of SDK. I read in changelog that Zendesk dev team have updated retrofit/okhttp versions several times and changed sdk target version. Or application requires some permissions which are not described in documentation.
0
Eric Nelson
This was due to a change made in a downstream service. We've made modifications to accomadate this change and a fix should be out in the next release at the end of September.
Thanks for reporting this!
1
Langston Smith
Anonymous voting via the Android Support SDK wasn't working for me neither on `5.1.0`. Yes, it's already enabled it in my settings.
Here's my setup:
I just bumped my app up to the Android Support SDK `5.1.1` version because the release notes say that `5.1.1` "Fixed an issue where article votes were not properly taken into account." https://developer.zendesk.com/documentation/classic-web-widget-sdks/support-sdk/android/release_notes/#511
However, I'm still not sure it's working or I guess I've now got a UI question.
I see 👇🏼 when I enable logging via `Logger.setLoggable(true)`
Nothing in the logs really makes me confident that the vote was actually registered with Zendesk's backend. Should I not worry?
The thumb color does change whenever I tap on it. Does that mean that the anonymous voting is working as intended? I kind of expected there to be some other UI that confirms the vote selection. Is this UI missing? Or is intended for the SDK to just highlight the selected thumbs up/down button and show nothing else?
0
Andrey Filatov
Hi, Langston!
In my case, when anonymous voting didn't work well, thumb icon was blinking and returning to start state. After downgrading the SDK version, which makes anonymous voting work well, the thumb icon stopped blinking and started to change and save background color.
So I think it works well in your case.
You can test it with returning to the same page in your knowledge base - thumb must save its background.
I hope it will help you.
Have a nice day!
0
Langston Smith
Great, thanks for the (quick) reply Andrey. I'm seeing no blinking and seeing that the previous vote selection is indeed saved if I return to the article.
I guess everything's working correctly. I'll move on to other work for now, but I'd still be interested to hear from Eric Nelson about whether no other voting UI confirmation is the intended SDK behavior.
0
Greg Katechis
Hi all! The UI behavior that you're seeing is intended, but I'd be happy to pass along feedback to the team with your thoughts on improving it! Just let me know what you're thinking and I'll let them know.
0
Langston Smith
Hey Greg, thanks for confirming. Could be cool to have some sort of UI that confirms and acknowledges that the vote was registered. Maybe a "Thank you for voting" or a "Vote confirmed" type of message in some sort of pop-up or underneath where the thumbs are.
0