PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

custom api

  1. biaroko
    Member

    Hi,

    I am looking to integrate a custom api into wordpress. It so happens that I received this api (let's call it api.php for now) from a supplier and am trying to find a good way to enable the functions in a few different forms on our website.

    Is it possible to integrate the api.php file in a way that I can access all functions and use them to create a few forms using gravityforms?

    I appreciate all help in this. I found a FAQ that might mean this is possible but I am not 100% sure:
    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Thanks in advance for the reply.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  2. You would like to use the API to create forms? I don't think that will be possible. However, whatever functions are exposed in the API can be used to pre-populate values in your form, if you want to do something like that. If you give us more specific information about what the API is for and how you want to use it in your forms, we can tell you if it's going to be possible.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  3. biaroko
    Member

    ok here is more detail.

    The API supplies functionality to request values from a database on a remote server. i.e. getValue('lastname', 1) and then returns a lastname for customerid 1.

    The idea is to get a few fields you can fill and then hit a button to process. in the above example you enter 1 into field customerid and click on a button to retrieve customer details where lastname is one of many details.

    I hope this is a bit clear :)

    Posted 11 years ago on Thursday January 10, 2013 | Permalink
  4. Yes, you can do this. You can use the gform_pre_render function to populate form fields. You would accept the information, query your external database, then pre-populate whatever additional fields you need to with information retrieved from the database. You may have to do this with two forms, depending on what information you need to collect to retrieve additional information from the database.

    http://www.gravityhelp.com/documentation/page/Gform_pre_render

    Posted 11 years ago on Friday January 11, 2013 | Permalink