Forum Discussion

Mmalre's avatar
7 years ago

How many API Calls per function?

Hello all 

As I read through our contract I found the billable API call restriction, and that just made me wonder what Lithium considers an API call and how that is calculated. 

For example, if a case goes from the case portal through a Salesforce connector back to Salesforce, is that one API call, or several depending on the data being shipped? 
If there is a comment on above case, is that one or several? 
If there is a comment on a comment, is that one or several API calls?

 

See where I'm getting with this? I sure hope so because I can't explain it any better, haha!

 

Thanks in advance

-Matt 

9 Replies

  • Mmalre's avatar
    Mmalre
    Ace
    7 years ago

    Hi VikasB

    Yeah I saw that post. I'm more out to understand how/if different functions contain one or several API calls. 

    If I'm to leverage the case portal for our client base, I need to ensure the contract reflect the expected API calls. But I can't really do that until I understand how they are calculated. 

    Thanks for the suggestion though! 

  • VikasB's avatar
    VikasB
    Boss
    7 years ago

    Mmalre

    API call will be counted when you will try to hit on an external network. Coming to your last comment, even if you are hitting the same API 10 times, it will be counted as 10 API hits. Or you can say different functions have the same API call but it will increase the billed call whenever any of the function will run and hit that API.

  • Mmalre's avatar
    Mmalre
    Ace
    7 years ago

    Thanks again VikasB. It does not really answer my question unfortunately. 

    What I need to know is: 
    Is every new case 1 API and only 1 API call?
    Is every new comment 1 API call and only 1 API call?
    Is a response on a comment 1 API call or more? 
    Is every case update 1 API call and only 1 API call?
    In what other areas will API calls be sent, and is their ratio the same? Aka one insert/update/delete = 1 call

     

    Thanks again

    -Matt

  • BeckyS's avatar
    BeckyS
    Lithium Alumni (Retired)
    7 years ago

    Mmalre I checked internally and here's some additional information.

    The answer to your question is: yes and no. We have LiQL, which is Lithium's query language, which can consolidate an entire thread, or you can get each one as an individual API call.

    For example, fetch recently posted threads retrieves the five most recently posted to threads across the community.

    <#assign apiVersion = “2.0”/>
    <#assign query = “SELECT id, body, subject, view_href, post_time, post_time_friendly, replies.count(*),
    kudos.sum(weight), author, board FROM messages WHERE depth=0 ORDER BY conversation.last_post_time
    DESC LIMIT 5" />
    <#assign topics = rest(apiVersion, “/search?q=” + query?url).data.items![] />
    <ul>
    <#list topics as message>
    <li><a href=“message.view_href”>message.subject</a>
    </#list>
    <ul>

    So, all of that’s basically a single API call.

    The  LiQL documentation should help some more:
    https://lithosphere.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&v2.main=liqlexamples#recentThreads

  • Mmalre's avatar
    Mmalre
    Ace
    7 years ago

    Thanks BeckyS, I'll check with out developers and see of this is all we need! 

    All the best

    -Matt

  • Mmalre's avatar
    Mmalre
    Ace
    7 years ago

    Hello again 
    It's still not very clear, and unfortunately I dont know how to explain it better but I can try and deepen my examples a little.  

    1. We're looking to implement Coveo as our search engine. One of the benefits (of many) with Coveo is that they can search across several repositories. Let's say that we're searching across the TKB, a SFdC repository and Youtube. 
    In this example, will ONE search result in ONE API call, or three? 

    2. Say that a portion of the user settings are on the Lithium Database, but another subset are tied to different areas of our backend SFdC database. Will an update in X amount of the SFdC (perhaps in different places within our SFdC instance) result in ONE call, or will it be several depending on where the information have to go in our SFdC instance? 

    3. If we implement the Case Portal functionality in Lithium and a user updates for example the license information in one table, the version number in another table and also putting in a comment in the case. In doing so it updates the status of the case in yet another table. All in SFdC. Is this ONE API call to salesforce, or several to all the different areas of our Salesforce instance. 

    Thanks again for your help, and sorry for being to thick headed :) 

    -Matt

  • YuriK's avatar
    YuriK
    Khoros Expert
    7 years ago

    Hey Matt,

    Lithium's "Billable API calls" refer to any API calls made from an external party to a Lithium community.  

    1) Since Coveo is an external party, you would have to check with them about how many API calls they make to Lithium and when. If I recall correctly, I believe they used to use a crawler behind the scenes and then store the results which would not result in API calls getting incremented, but it's best to check with them.

    Unfortunately, I'm not too familiar with our SFDC connector functionality, so I would have to defer to VimalGa for the other 2 questions.

    Hope this helps, 

    Yuri

  • VimalGa's avatar
    VimalGa
    Lithium Alumni (Retired)
    7 years ago

    Hi Mmalre,

    Here are my responses to the last two.

    1. User settings or profile related changes will result in ONE call to your SFDC instance while updating the changes

    2. Case portal - fields could be dynamic & present in multiple tables, will result in more than one calls

    Hope this clarifies?

    Thanks