-1

I’m trying to create a new user on dummyapi.io using Postman, but I keep getting a PARAMS_NOT_VALID error. I’m sending a POST request to the /user/create route with the firstName, lastName, and email fields in the request body, but I keep getting the same error. Does anyone know what could be causing this issue? Are there any additional fields I should include or any specific values I should send? Any help would be greatly appreciated.

I was trying to enter the data in Json format

{
  "firstName": "Juan",
  "lastName": "Pérez",
  "email": "juan.perez@example.com"
}

This is the error that rings the request in postman

{
    "error": "PARAMS_NOT_VALID"
}

Here's what the dummyapi.io documentation says:

Create User
Create new user, return created user data.
Body: User Create (firstName, lastName, email are required)
POST
/user/create
Response: User

1 Answers1

0

You need to make sure you have:

  • valid app-id HTTP request header set
  • valid URL: https://dummyapi.io/data/v1/user/create
  • expected request method: POST
  • Content-Type header should be set to application/json (in Postman select Body -> Raw -> JSON (from the dropdown))
  • a valid request body (see below)

Set content-type in Postman version 10.16 on Linux

I've tested the following request with success both in curl and Postman:

curl --location 'https://dummyapi.io/data/v1/user/create' \
--header 'app-id: <replace-with-your-app-id>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "firstName": "myFirstname",
  "lastName": "myLastname",
  "email": "my.email@example.com"
}'

You can either just run the curl command or import it into Postman using Import and then just paste the command.

Import into Postman on Postman version 10.16 on Linux

Expected result should be something along the lines of this:

Status 200 Ok

{
    "id": "64d515120dc40b433a86eb5f",
    "firstName": "myFirstname",
    "lastName": "myLastname",
    "email": "my.email@example.com",
    "registerDate": "2023-08-10T16:49:22.275Z",
    "updatedDate": "2023-08-10T16:49:22.275Z"
}
Mushroomator
  • 6,516
  • 1
  • 10
  • 27