QuickBase Community Home Page

How to send XML request

This will probably be a softball for many of you.  The API documentation for EditRecord is typical in that it offers an XML Request example as well as a URL alternative.  From the documentation, here is the XML Post request method:

-------------------------------

POST https://www.quickbase.com/db/bfxjk9t7g HTTP/1.0
Content-Type: application/xml
Content-Length:
QUICKBASE-ACTION:API_EditRecord
<qdbapi>
   <udata>mydata</udata>
   <rid>1</rid>
   <field fid="94">33</field>
</qdbapi>
---------------------------------

My question is:  What is the context for this code?  Where does one write this XML request string?  Is it part of a larger XML document?  How does one call it?  For example, say I want a button to edit another record using the XML request method.

Could someone please give a simple, but complete example of the implementation of an XML request for, say, editing a record? 

And if the above documentation code is really not the way to go, I'd be happy to use a jQuery alternative.  I just would like to understand the context. 

Thanks for your help.

    Cancel

    The QuickBase API documents HTTP requests and response formats and is agnostic to which language (javascript, ruby, python, perl, java, ...) is used to make the network calls. So the documentation describes the HTTP format of the request and response. For an introduction see:

    HTTP Made Really Easy

    http://www.jmarshall.com/easy/http/

    Additionally, QuickBase generally allows parameters to be sent in HTTP request (1) through the url, (2) in the headers, or (3) in the optional request body. 

    Many of these details become transparent if you just mimic an example. Here is how your request could be sent using JavaScript and jQuery.

    http://pastie.org/2355958

    However, I could probably come up with a dozen different ways to send that same request by playing with the method, headers, and request body.

      Cancel

      So there are a few questions that come up in response to your question.  Like:

      • What is the reason for the implementation?
      • What code language are you wanting to use?
      • What is you technical ability?

      You do need to have some code writing knowledge to understand what you are doing and why.

      There is a sdk for almost every popular code language.  Here is a link:

      http://quickbase.intuit.com/developer/category/knowledge-base-tags/sdk

      If you know which language you want to use then the above link should help.

      But here is an effort to answer your question.

      If you are hosting the page that will edit a record in Quickbase then you might want to use jQuery.  Here is an example:

      http://www.pastie.org/2356128

      Add this code to a user defined page.  Customize->Application->Page->Add Page->Text.

      Change the user specific sections like YOUR PAGE TITLE, YOURDBID, YOURRID, etc...

      Save it with a name that ends in .html.

      If you would like some more hands on assistance, please feel free to contact me using me contact information in my profile.

        Cancel

         If you can't use jQuery, you can use Ruby outside the browser .  The following code generates your XML and sends it to QuickBase -

         

        require 'quickbase_client'

        qbc = QuickBase::Client.new("quickbase_username","quickbase_password")

        qbc.addFieldValuePair(nil,"94",nil"33")

        qbc.editRecord("bfxjk9t7g","1",qbc.fvlist)

         

        # if you know the name of the '94' field, you can use -

        qbc = QuickBase::Client.new("quickbase_username","quickbase_password")

        qbc.editRecord("bfxjk9t7g","1",{"field_name" => "33"})

         

        # 1) download ruby from http://rubyforge.org/frs/download.php/73722/rubyinstaller-1.9.2-p136.exe

        # 2) download ruby quickbase_client by typing 'gem install quickbase_client'

        # 3) run this ruby script by typing 'ruby edit_record.rb'

         

        # More info here - https://www.quickbase.com/db/bcdcajmrf

        # quickbase_client - https://rubygems.org/gems/quickbase_client

         

         

          Cancel

          Thanks to Dan, Charles, and Gareth for their thoughtful and to-the-point replies.  I do have considerable experience with JavaScript, QuickBaseClient.js and the URL method of the QuickBase HTTP API.  I just couldn't figure out how to implement the XML method.  Dan's example certainly pointed the way, and Charle's code for insertion into a QB custom page absolutely hit the mark. I get it now and can proceed to further exploration and learning. Thanks again for the responses.

            Cancel
            Contribute an answer

            People come to QuickBase Community for help and answers—we want to let them know that we're here to listen and share our knowledge. We do that with the style and format of our responses. Here are five guidelines:

            1. Keep it conversational. When answering questions, write like you speak. Imagine you're explaining something to a trusted friend, using simple, everyday language. Avoid jargon and technical terms when possible. When no other word will do, explain technical terms in plain English.
            2. Be clear and state the answer right up front. Ask yourself what specific information the person really needs and then provide it. Stick to the topic and avoid unnecessary details. Break information down into a numbered or bulleted list and highlight the most important details in bold.
            3. Be concise. Aim for no more than two short sentences in a paragraph, and try to keep paragraphs to two lines. A wall of text can look intimidating and many won't read it, so break it up. It's okay to link to other resources for more details, but avoid giving answers that contain little more than a link.
            4. Be a good listener. When people post very general questions, take a second to try to understand what they're really looking for. Then, provide a response that guides them to the best possible outcome.
            5. Be encouraging and positive. Look for ways to eliminate uncertainty by anticipating people's concerns. Make it apparent that we really like helping them achieve positive outcomes.
            Cancel

            Similar questions other people found helpful: