LoudVoice issues

Hi.
I'm trying to implement OneAll login and LoudVoice into my website.
The first "issue" I'm having is that I have to login separately into my site and into the LoudVoice widget. Is there any way to login automatically into LoudVoice as soon as I login into my website?
The seocond problem is related to localization. Is there any way to set the display language of the LoudVoice widget?
Thank you in advance.

Best Answer

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited January 2017 Answer ✓
    Hello,

    yes you can login a user into LoudVoice by sending a PUT request with this POST data:

    { "request: { "author_session": { "author": { "author_reference" => "user-id", "allow_create_author_reference" => true, "name' => "user-name", "email" => "user-email", "website_url" => "http://user-website", "picture_url" => "http://user-picture", "ip_address" => "user-ip-v4" } } } }

    To

    https://your-subdomain.api.oneall.com/loudvoice/authors/sessions.json

    This request should be send when the user logs in into your system. This will start a new LoudVoice
    session for the received user data.

    Please update the data and replace all "user-*" placeholders with your own values.
    Also replace "your-subdomain" by your own subdomain.

    After having send the PUT request, please take the author_session_token of the result received by the API and save it in the user's session data.

    Then include this line in the JavaScript used to render LoudVoice:

    _oneall.push(['loudvoice', 'set_author_session_token', 'your-author_session_token']);

    Replace your-author_session_token by the author_session_token that you have saved in the user's session data.

    We are currently working on a full documentation of LoudVoice!

Answers

  • edited January 2017
    Thank you so much. I'll try and let you know if something goes wrong.
    The picture, url and IPV4 are required parameters? Can I omit them?
    This, beside the full documentation, should maybe even automatically implemented in the OneAll system... I don't think it's so rare for developers to use this kind of solution...

    What about the localization feature? Is there anything I can do for it? Should I open another thread for this?
  • edited January 2017
    I can't make the request work. Here's the server response:
    response: { request: { date: "Fri, 06 Jan 2017 17:01:39 +0100", resource: "/loudvoice/authors/sessions.json", status: { flag: "error", code: 400, info: "please check the format of your request", } } }
    The POST data is generated from this php code:
    $data = [ 'request'=>[ 'author_session'=>[ 'author'=>[ 'author_reference'=>$uid, 'allow_create_author_reference' => true, 'name' => $name, 'email' => $email, 'website_url' => $web, 'picture_url' => $pic, 'ip_address' => $ip_addr ] ] ] ];
  • I solved. There was an issue with how the data was sent. I used the http_build_query function instead of json_encode in the curl CURLOPT_POSTFIELDS setting.
    But then I had another issue. If I put the 'author_reference' key, the server won't accept it and throws an error saying that the reference is invalid. If I omit the parameter the server replies correctly.
  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited January 2017
    Hello,

    we have now fixed an error where the LoudVoice API could wrongly return an error message for new references.
    Could you please try again?

    Do not omit the author_reference, otherwise the API will create a new author for each request.

    Regards,
  • Hello,
    I am trying to achieve the same results (LoudVoice login through Social Login).
    The problem I am facing is that a new instance of a Guest User is created with no reference to the social profile.

    I think I am setting the author_reference in the wrong way. Which data from the Social Login Connection Api should be assigned the author_reference field?
    I tried both the user_token and the identity_token but it doesn't seem the case.

    Thanks in advance
    Regards
  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    Hi Massimo,

    to setup an author for an identity, the following JSON must be used:

    { "request: { "author_session": { "author": { "identity_token" => "user-identity_token", "allow_create_author_reference" => true, "ip_address" => "user-ip-v4" } } } }

    Please replace the user-* fields by your own values.

    The request must be send to:
    https://your-subdomain.api.oneall.com/loudvoice/authors/sessions.json

    Replace "your-subdomain" by your own subdomain ;)

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.