Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

providing json payload

$
0
0
by Paul Gatewood.  

I have not been able to find clear answer to this question:

Is it possible to provide the argument(s) for a webservice function as a json object?

For example, core_user_create_users specifies that the single argument "users" is an array of object.

The example REST POST parameters shows providing each attribute for each user as a separate parameter, e.g.

users[0][username]= string
users[0][firstname]= string
users[0][lastname]= string
users[0][email]= string
The examples I find via searching are also constructed like this.

Is it not possible to supply a single arg with a value akin to what is returned by a call to core_user_get_users, e.g. something like the following?

[
  {
    "username": "testuser02",
    "firstname": "firstname02",
    "lastname": "lastname02",
    "email": "testuser02@dev.null"
  }
]

Or perhaps to supply the argument in the body, of the request, e.g.

{
  "users": [
    {
        "username": "testuser02",
        "firstname": "firstname02",
        "lastname": "lastname02",
        "email": "testuser02@dev.null"
    }
  ]
}

My thanks to anyone who can shed any light on this.


Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>