NetTalk Central

Author Topic: Web service JSON input  (Read 4476 times)

RichBowman

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • Email
Web service JSON input
« on: May 07, 2018, 05:46:48 AM »
I wish to call a NetTalk web service with a JSON string as the input parameter. I have 2 questions:

1. Do I do a GET or POST?

2. What does the url look like?

Thanks,

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Web service JSON input
« Reply #1 on: May 07, 2018, 07:10:39 AM »
Hi Rich,

If its a REST web service then you can usually use either GET or POST. Usually GET if the payload is small.

If your json is large POST is more appropriate as there can be limitations to the size of a URL.

You just stick the json onto the URL, eg:

https://move-api.inhabit.com.au/v1/5/contactlist?fields={"fields":["sysid","preferences"]}&filter={"filter":[{"field":"surname","value":"'cooper'","operator":"contains"}]}

Regards
Bill

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Web service JSON input
« Reply #2 on: May 07, 2018, 07:30:05 AM »
Hi Rich,

Make the Service Method.
Then check out the auto-documented page for the method.

The short answer is that there are _lots_ of ways to call the method. But I'd recommend using the POST with JSON data.

cheers
Bruce