1

I'm trying to build a form using cockpit CMS. Link : http://localhost/misc/cockpit .

As in the docs, I have created a token and given '*' privilage and using it in the endpoint like this: http://localhost/misc/cockpit/api/forms/submit/leads?token=eb29a1e1bc5d90cbd8a6599b3363ee . My form name is 'leads'. When is try to submit form using POST call with JSON object with a form property, i'm getting 404 error.

{
    "form": {
        "field1": "value1",
        "field2": "value2"
    }
}

Wanted to know where i'm going wrong.

Marco Daniel
  • 5,467
  • 5
  • 28
  • 36
huduga
  • 39
  • 6
  • `404 error` means the URL doesn't exist/was not found – brombeer Dec 04 '20 at 14:23
  • I know that. but if don't use a security token or use the wrong token, I get {"error":"Unauthorized"} error. – huduga Dec 04 '20 at 14:33
  • be aware that cockpit api is case sensitive, are you sure your form name is 'leads'? for example can you access `http://localhost/misc/cockpit/forms/form/leads`? – Marco Daniel Jan 04 '21 at 19:13
  • I just had the same problem, and the solution was to correct the JSON string that was posted, now your JSON looks good, but check how you are sending it! – Dejan Dozet Mar 11 '22 at 20:37

0 Answers0