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
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.
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)