1.8 API POST and PUT Operations

Hi Everyone,

I’m struggeling with the 1.8 API from the Beta Version. All GET Operations that I tested work well but not so PUT and POST Opertations. So I guess that the Header is probably okay and that the problem is in the Body of the Request.
The error message I’m getting is: "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the “access token” parameter."
When I analysed the Post Request from Swagger to create a new Layout named test, I only got following Body from the Network Analyzer in Firefox:

How should the structure of the Body look like?

Thanks in advance

The access_token parameter is part of the authentication process and is actually an oAuth token which authenticates you against the route you are trying to use.

The best way to provide this token is to use an Authorization header with the value Bearer $token

If this is not possible, then the token will be resolved from the form_data you send with your request. The parameter name it will search for is access_token. Essentially this is $_POST in php terms.

Hi Dan,

Thanks, I was providing the access_token over the URL like:
This only worked for GET Operations.

But now I’m already facing the next problem: How do I provide the name parameter for a new Layout? For example to add a new Layout named “test”, I’m getting Error 422 for following request:

POST http://localhost/api/layout
Authorization: Bearer 1234
Content-Type: application/json

Yes, that is correct - post parameters are send as form_data not as query_params (those are params in the URL). The header is the best way forwards as that is the same for all requests.

What you’ve posted looks like a raw HTTP request, in which case you’d need form data - like:

POST http://localhost/api/layout HTTP/1.1
Host: <host>
Authorization: Bearer 1234
Cache-Control: no-cache
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="name"


Obviously you’d need to pass the other required parameters - as per the API document.