Collection runner and Memsource API

Hello.
Attached is the collection and CSV file I am using:

What is wrong that I do keep getting 400.
The call in question is documented here:
https://cloud.memsource.com/web/docs/api#operation/updateUserV2

your fields which take in boolean eg: mayEditApprovedTerms , and others are passed as TRUE instead of “true”. SO update your csv to have boolean to be true

and also in collection you have body as

{
"email": {{email}},
"mayEditApprovedTerms": {{mayEditApprovedTerms}}
}

but it should be like :

{
"email": "{{email}}",
"mayEditApprovedTerms": {{mayEditApprovedTerms}}
}

meaning all strings like email should be enclosed with double quotes “{{email}}” and boolean or numbers should be like as it is ( without double quotes) but should be passed as true instead of TRUE

Thank you very much for your reply.

  1. You see TRUE in capital only because you preview the file in the browser, once you download the file and open in Notepad++ you’ll notice that it is actually true not TRUE
  2. Here are the changes I have made to the collection:
    import_users.postman_collection_new.json - Google Drive
    seems to be fine now.
    However the collection still fails to be run successfully.
    One more thing which worries me a bit that when I preview my CSV here:
    https://i.imgur.com/nU87fqR.png
    I can see true values in quotes which I believe should not be the case.
    Any advice on the above?
    All the best
    Wojciech

use this you were missing some comma and closing brackets

{

  "userName": "{{userName}}",

  "firstName": "{{firstName}}",

  "lastName": "{{lastName}}",

  "email": "{{email}}",

  "password": "{{password}}",

  "role": "{{role}}",

  "timezone": "{{timezone}}",

  "note": "{{note}}",

  "mayEditApprovedTerms": {{mayEditApprovedTerms}},

  "mayRejectJobs": {{mayRejectJobs}},

  "editorMachineTranslateEnabled": {{editorMachineTranslateEnabled}},

  "receiveNewsletter": {{receiveNewsletter}},

  "mayEditTranslationMemory": {{mayEditTranslationMemory}},

  "sourceLangs": [

    "{{sourceLangs}}"

  ],

  "targetLangs": [

    "{{targetLangs}}"

  ],

  "workflowSteps": [

    {

      "id": "{{workflowSteps}}"

    }

  ],

  "clients": [

    {

      "id": "{{clients}}"

    }

  ],

  "domains": [

    {

      "id": "{{domains}}"

    }

  ],

  "subDomains": [

    {

      "id": "{{subDomains}}"

    }

  ],

  "projectBusinessUnits": [

    {

      "id": "{{projectBusinessUnits}}"

    }

  ],

  "automationWidgets": [

    {

      "id": "{{automationWidgets}}"

    }

  ]

}

Postman test script is smart enough to show json errors:

You can see what was actually received in collection runner by enabling save request:

response :

so even the server response says where was the issue

Thanks a lot for the hints.
It indeed worked, the only problem I have experienced was that I cannot send empty values within CSV which is a problem as I do not want to pass any value sometimes.
Any hint would be appreciated.
All the best
Wojciech

You can pass empty values , blank column will be passed as “”

If you want to pass something else then you can use local variable

pm.variables.set("key","value")

If you want environment value to get reflected instead of value from data csv use :

pm.variables.set("key",pm.environment.get("key"))

Because precedence is as:

Local>data>environment so on (opposite of scope)

Thanks for following up.
When I leave a value for the key empty in my CSV I am getting this error:


All the best
Wojciech