Discussions

Expand all | Collapse all

API Issue

  • 1.  API Issue

    Posted 22 days ago
    Hello All,

    I am having trouble creating a new lead which is coming from my phone system and pushing to QB. This is what i am using but i feel like my auth is wrong I took out my usertoken on purpose but what am i missing?

    https://seniorchoiceplans.quickbase.com/db/bqfx8k92p?a=API_AddRecord&_fid_7=[[phone_number]]&_fid_83=[[custom1]]&usertoken=


    ------------------------------
    Benjamin Brooks
    ------------------------------


  • 2.  RE: API Issue

    Posted 22 days ago
    It wants an Application Token.  In the Advanced settings for the app, you will either need to disable the need for an application token or else generate one and provide it.

    ....&apptoken=hgsadhjdsajdsakjdasadsjkh"

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: API Issue

    Posted 22 days ago
    So use both the user token and app token?

    ------------------------------
    Benjamin Brooks
    ------------------------------



  • 4.  RE: API Issue

    Posted 22 days ago
    I think that if you have the need for an application token enabled then you have to provide an application token. So yes both an application token and a user token.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: API Issue

    Posted 22 days ago
    Works now thank yoU!

    ------------------------------
    Benjamin Brooks
    ------------------------------



  • 6.  RE: API Issue

    Posted 22 days ago
    To then pull up the record that we just created would i just add:

    &a=er&key=[[phone_number]] 

    Since that is the key is is phone number?

    ------------------------------
    Benjamin Brooks
    ------------------------------



  • 7.  RE: API Issue

    Posted 22 days ago
    No, that wont work.

    To diplay the newly created record, you add the line

    & "&disprec=1"  That will display the record in view mode.

    But in your case, you happen to know the Key field.

    So I think that you can turn your whole Add Record into a formula variable and then do tnhis

    var text AddRecord = "... your code goes here ";
    var text EditRecord = "https://seniorchoiceplans.quickbase.com/db/bqfx8k92p" & "?a=er&key=" & [Phone number]

    $AddRecord
    &  "&rdr=" & URLEncode($EditRecord)


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 8.  RE: API Issue

    Posted 22 days ago
    I can put that in a url to push? This is coming from my phone system where i have URL's that i can put in there. Wouldnt this fall under XML coding? Sorry if i sound dumb I'm learning!

    ------------------------------
    Benjamin Brooks
    ------------------------------



  • 9.  RE: API Issue

    Posted 22 days ago
    If a machine is issuing the API call, then why do you want to open up the record for editing.   ie why the follow up question about  

    To then pull up the record that we just created would i just add:

    &a=er&key=[[phone_number]] 

    who or what is "pulling up" the record?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 10.  RE: API Issue

    Posted 22 days ago
    I see what you are saying, the call is coming from my phone system where we are getting a new call from  tv commercial. What it has is a URL that can automatically be pushed when the call comes in. The goal was to have an API create the file with the phone number taken from the phone system [[phone_number]] which is the key field in QB, and the [[custom_1]] which is the lead source it came from.  It would then show the record that it just made in quickbase so the client they are talking to on the phones file pulls up on their screen. This is easily done when the record is already created by just using:

    https://seniorchoiceplans.quickbase.com/db/bqfx8k92p?a=er&key=[[phone_number]] 

    but in this case as we are trying to work through the record needs to be created first so that it can then pull up the form.


    ------------------------------
    Benjamin Brooks
    ------------------------------



  • 11.  RE: API Issue

    Posted 22 days ago
    But you see that the concept does not make sense.  You are trying to get some kind of screen pop on your operators computer when a machine (phone system) fires an API.  But how could it possibly know which screen to pop up on?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 12.  RE: API Issue

    Posted 22 days ago
    The phone system pops up a new tab in the browser that they are using, based on the URL that it is told to go to. In our phone system it is called a get call launch where it can launch a URL strand that we tell it to.

    ------------------------------
    Benjamin Brooks
    ------------------------------



  • 13.  RE: API Issue

    Posted 22 days ago
    Edited by Austin K 22 days ago
    https://help.quickbase.com/api-guide/add_record.html

    That should be helpful. They have a part at the bottom showing how to use it in a URL.

    Are your fields named "[[phone number]]" and "[[cutsom1]]", with the extra bracket? 

    You will need to URLEncode the fields you are trying to use in this URL.

    If you look at one of the "Add" buttons that is created in a relationship it can help guide you in the right direction. Here is one cleaned up with the AddRecord function. If you are adding a record to a child table or related table then don't forget to bring along the record id for the "Related X" field on the child table so it knows what record it is related to in the parent. You may or may not need this.

    URLRoot() & "db/" & [_DBID_MY_DBID] & "?a=API_AddRecord&_fid_1782=" & URLEncode ([Record ID#]) & "&_fid_7=" & URLEncode ([Phone Number]) & "&_fid_83=" & URLEncode ([custom1])-
    I see you got it working though so nevermind, but URL encoding is important. You should do it or you may find yourself with some bad data or another failure depending what is contained in there.


  • 14.  RE: API Issue

    Posted 22 days ago
    Austin,

    Thank you for that! The double brackets are fields from my phone system that is how they are formatted for variable information!

    ------------------------------
    Benjamin Brooks
    ------------------------------