Forum Discussion

npiette's avatar
npiette
Helper
8 years ago

What should the community-name be in the URL call?

Hey Community Members, perhaps you can help me with something.

 

The thought process here is that I am currently building an app that will take a spread sheet of email address, find their userid by searching the community for the email address, using the http://community.lithium.com/community-name/restapi/vc/users/email/[email] api and then adding the role using the role update api. (I have a separate file that links @company.com emails to the roleIDs) The documentation seems to indicate I need to authenticate before I start making these calls but I'm not seeing documentation regarding header information or anything else that might indicate where to put the auth key. 

 

1) Do I need to authenticate before calling those API's 

2) Is there an easy place to find that community-name, is it the ID or the text name? What exactly is the api expecting here. The example provided doesn't change community-name in the example for email look up but I am not able to apply the same in my community. 

 

Happy to share the job when it's finished as I suspect many others are getting tired of manually updating roles, just need help understanding the API a little more. 

 

Let me know,

 

Nick

  • Hi npiette

    if you are making "standalone" calls (i.e. not within a custom component in Studio) you will need to handle authentication. Please refer to the "API Authentication" section in our documentation for more information.

    Kind Regards,

6 Replies

  • npiette - You can make this call without passing the name as well, in this format and it will work fine.

    https://community.lithium.com/restapi/vc/users/email/[email] 

    In case you need to know what this community name is, you can find yours here -  https://community.lithium.com/restapi/vc/id 

     

    Regarding the authentication, if you are making the calls from within the community, you can make them as an admin and no need to authenticate.

     

    I hope this helps.

     

     

  • npiette VarunGrazitti : Looks like Lithium API is not providing Email value in the response.

     

     

     
     npiette : Did you tried this call in your community.
     
    If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

    Thanks & Regards,
    Abhishek Illindra

     

     

  • npiette's avatar
    npiette
    Helper
    8 years ago

    Actually it looks like an issue of "logged in" vs "not logged in" When I run the rest call in a browser where I haven't logged into lithium I get that response, if I try it from a browser I have logged in from everything works fine. My next question is ok, I see how to call the rest API to get the login credential key, but whats the right query parameter to pass the key along in the url string. Any ideas?

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    8 years ago

    Hi npiette

    if you are making "standalone" calls (i.e. not within a custom component in Studio) you will need to handle authentication. Please refer to the "API Authentication" section in our documentation for more information.

    Kind Regards,

  • RhallTalend's avatar
    RhallTalend
    Guide
    6 years ago

    Hi PaoloT,

    I am trying the same as npiette and am getting an error every time. I have an auth token that works (I have been using the v2 API, but it refuses to allow me to fire a LiQL query with email as a where clause for users), but I keep getting the following error....

    200||{"response":{"status":"error","error":{"code":100,"message":"An Unexpected Error has occurred."}}}

     

    The url I am firing is ....

    http://community.name.com/restapi/vc/users/email/myemail@company.com?restapi.response_format=json

     

    Any ideas?