当前位置:网站首页>Postman batch production body information (realize batch modification of data)

Postman batch production body information (realize batch modification of data)

2022-04-23 16:09:00 Learning is boundless, happy to make a boat

The requirements document : Update candidate customization information

Test case execution : Use case information

  • API Interface

http://api-platform.staging-8.svc.k8s.staging.mokahr.com:8080/api-platform/v1/candidate/customField/update

  • Java Internal interface

http://ats-candidate-offline.staging-8.svc.k8s.staging.mokahr.com:8080/api/inner/ats-candidate-offline/candidate/custom_fields/update

Through the first API The platform obtains user-defined field information

curl --silent --location --request GET 'http://api-platform.staging-8.svc.k8s.staging.mokahr.com:8080/api-platform/v1/candidates/custom_fields' \
--header 'Authorization: Basic bGl2aW5nc2ltcGxlOg==' \
--header 'Cookie: connect.sid=s%3AHH5fkO7fpcOSy1nt-zcAwsc8Dg9AZuMi.390HypGU2awXlNPhFmTaaWYbP%2FNS6bVmZBqnQYRS1j8'

Modify individual candidates curl as follows

curl --silent --location --request POST 'http://api-platform.staging-8.svc.k8s.staging.mokahr.com:8080/api-platform/v1/candidate/customField/update' \
--header 'authCode: DMyoCupHTMKmYQ4QANQVxe7AWEkscMTj' \
--header 'Authorization: Basic dGVzdDE6' \
--header 'Content-Type: application/json' \
--data-raw '{
    "updateCustomFieldsReqDTOList": [
        {
            "candidateId": 201203910,
            "orgId": "livingsimple",
            "operatorEmail": "wangkunlun@mokahr.com",
            "hireMode": 1,
            "customIdAndDetailDTOList": [
                {
                    "id": 270,
                    "detail": {"startDate":"2011-09 00:00:00","endDate":"2015-08 00:00:00"},
                    "type": "date_group_info"
                }
            ]
        },
    ]
}'

postman Steps of generating candidates in batch by parameterization

1、postman To write Pre-request Script, Script . Batch build body Content implementation body Multiple candidate functions are introduced into the body

 

The code is as follows

var number=10;    -- Set variables to control   Number of candidates per request 
var orgId="livingsimple";
var operatorEmail="wangkunlun@mokahr.com";
var Clist = [201213489,201213488,201213487,201213486,201213485,201213484,201213483];  -- Query the modifiable candidates through the database ID


function add(count){
var str1 = new Array(count);
for (i = 0; i < count; i++) {
var str2 = {};
str2["candidateId"]=Clist[i];
str2["hireMode"]=1;
str2["orgId"]=orgId;
str2["operatorEmail"]=operatorEmail;
var customIdAndDetailDTOList=[{
"id": 263,
"detail": " Single line text modification 300",
"type": "string_info"
}];
str2["customIdAndDetailDTOList"]=customIdAndDetailDTOList;
str1[i]=str2;
}
console.info(str1);
pm.globals.set("body", JSON.stringify(str1));
}
add(number);

2、body The parameters are as follows

版权声明
本文为[Learning is boundless, happy to make a boat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231403594097.html

随机推荐