Beginner - how to make a remote web service call?

Hi,

i am trying to make a simple remote api call , through an url,

https://www.XXX.com/route1/call/jsonrpc2

using POST with a JSON payload ,

{ "jsonrpc": "2.0", "method": "api", "params":[
{
    "opts" : {
            "login" : "xxx",
            "password" : "xxx",
            "db" : "dbname1",
            "host": "host-ip",
            "port": "4321",
            "protocol": "https"
    },
    "moduleDetail" : {
        "model" : "login",
        "method" : "login",
        "args" : {},
        "filter" : "",
        "fields" : "",
        "domain" : "",
        "offset" : "",
        "limit" : "",
        "sort" : "",
        "resource_id":""
    }
} ], "id": 1}

what i did was ,

  1. create a service , select ->remote service->HTTP Service
  2. at the page config , i am stuck and do not know what to do

can any one provide some advice for how to proceed ?

In the first place , i am not sure whether i am going in the right direction or
i need to setup using Script->Javascript/PHP/Python for custom service ?

Thanks.

1 Like

Hi

Did you ever figured it out? I am also stuck in similar scenario.
BaseURL ???
In swagger json, what are the values of ‘host’, ‘basePath’ and ‘schemes’ ?

I short, I need to access a remote web service:
POST https://abc.def.com/info
with a payload:
"token" : "gfhiasgertttyy"

And I need a dsp service for the above call as shown below:
POST http://mydspinstance.com:8080/api/v2/auth/token
with a payload:
"token" : "gfhiasgertttyy"

How can I accomplish this?

1 Like

I’m getting below error when calling my newly created DSP web service through curl :
{“error”:{“context”:null,“message”:“Undefined offset: 1”,“code”:500,“trace”:[ … ] }

Any clues ???

It seems this thread is dead. Anyway for community info, I created two threads regarding this - one for POST request and for GET request with Authorization Bearer headers. Hoping it may save hours/days for someone.

Thanks.

1 Like

Hey @abhinavg and @kalmenchia,

Have you checked out our resources?

Thanks,
@AlexBowen