API and Database fields…

This topic contains 11 replies, has 3 voices, and was last updated by  Naveen Giri 5 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #515542

    Rodney Chatman
    Expired Member
    Post count: 89

    Hi,

    Do the database fields align 1 to 1 with api variables? For example, if I created an additional address field called

    bldgNo

    in the

    wp_geodir_gd_business_detail

    table would I be able to add values to that field via the API with something like:

    /wp-json/geodir/v2/places/?status=publish&title='Listing Name'&bldgNo='building number'&street='street name'

    Can I add/change database table field values by using the fields name in the api PUT?

    #515546

    Alex Rollin
    Moderator
    Post count: 27815

    The developer that normally works on the API is out for the week.

    In general, the answer to your question is yes, with the exception that field keys are always lowercase.

    I will ask the developers to take a look at your questions as soon as possible.

    #515569

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Rodney,

    if you want to update field value for any place cpt post using api call.
    you can do that with POST request to /wp-json/geodir/v2/places/< id > endpoint.

    check this doc
    https://wpgeodirectory.com/docs-v2/api/posts/#update-endpoint

    Thanks

    #515584

    Rodney Chatman
    Expired Member
    Post count: 89

    I’ve added the field to the database, as stated above but I don’t see the json object when I do a GET to

    wp-json/geodir/v2/business

    .

    #515585

    Rodney Chatman
    Expired Member
    Post count: 89

    Also…what is the software used in the docs to create GET and POST?

    #515589

    Naveen Giri
    Moderator
    Post count: 1559
    This reply has been marked as private.
    #515591

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #515740

    Naveen Giri
    Moderator
    Post count: 1559

    Sure, We have docs maintain here for GD API routes
    https://wpgeodirectory.com/docs-v2/api/

    you can check it and if you still face any issue, we are here.
    can we close this task or you still have any query.

    Thanks

    #516456

    Rodney Chatman
    Expired Member
    Post count: 89

    Hi Naveen,

    I am still unable to see or populate the bldgno field via the API. I have added the field in the the listings detail table of the db but it’s not accessible via the API. Any ideas?

    #516596

    Naveen Giri
    Moderator
    Post count: 1559
    This reply has been marked as private.
    #517224

    Rodney Chatman
    Expired Member
    Post count: 89
    This reply has been marked as private.
    #517248

    Naveen Giri
    Moderator
    Post count: 1559
    This reply has been marked as private.
Viewing 12 posts - 1 through 12 (of 12 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount