JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
NDR Roadmap
NDR RoadMap (Sprint 7)
Unit Testing
Logic
More
Share
Explore
NDR RoadMap (Sprint 7)
Bulk Upload NDR File Validations
Upload File Format:
https://docs.google.com/spreadsheets/d/1QYeCW2nz1H0d-UJr0buSUZzXGPtBGkToiTAgujS7RKU/edit?usp=sharing
DEV API:
END Points(Upload CSV File): http://142.93.222.52/ndr/validate-csv/
END Points(Submit Action): http://142.93.222.52/ndr/action/
Prod API:
Upload CSV:
http://ndr.pickrr.com/ndr/validate-csv/
Submit Action:
https://ndr.pickrr.com/ndr/action/
Upload CSV File:
curl --location --request POST 'http://142.93.222.52/ndr/bulk-ndr-upload/' \
--header 'auth-token: asldhjasdb' \
--header 'child-auth-token: dskjbfkjskjdfksdf' \
--form 'bulk_csv_file=@"/Users/bpraveen/Downloads/Pickrr_DOWNLOAD_NDR_REPORT FORMAT - Pickrr_DOWNLOAD_NDR_REPORT FORMAT (1).csv"'
Submit
form-data
with key-value :
bulk_csv_file
This endpoint validates the CSV file and sends sucs_awbs[] and err_awbs[] as a response.
The err_awbs contain an array of objects, each key contains err and value objects.
{
"awb": "742082485055",
"ndr_action": "RTO",
"correct_phone_number": "",
"correct_address": {
"err": "Customer Address exceeds limit of 60 characters",
"value": "sdfsfbsdfbnsdubfiusdbifbsiubfisbnfiubsiufbisubfisbfbsibsbvlssfjsbkljnvhbisunbvnhcbliundslfndskn"
},
"future_delivery_date": {
"err": "Future Delivery Date can be maximum 15 days in future",
"value": "13/08/2021"
},
"seller_remarks": ""
}
Iterate the err_awbs[] array and show the edit screen to the seller, seller either edit the respective error or delete the NDR from the screen.
Submit NDR is enabled when err_awbs[] is empty or all err_awbs errors are fixed.
On Submit pass the same response structure of bulk_ndr_upload API with the updated value of error object in err_awbs[].
For Example:
"future_delivery_date": {
"err": "Future Delivery Date can be maximum 15 days in future",
"value": "DD/MM/YYYY"
},
OR
"future_delivery_date": DD/MM/YYYY
Submit Action API
:
DEV/PROD
Submit the response of
bulk-ndr-upload
API to
submit-upload-ndr
API with correction in
err_awbs[]
POST: CURL
curl --location --request POST 'http://142.93.222.52/ndr/submit-uploaded-ndr/' \
--header 'auth-token: adsasd' \
--header 'child-auth-token: jkdnandjknad' \
--header 'Content-Type: application/json' \
--data-raw '{
"sucs_awbs": [
{
"awb": "742082478770",
"ndr_action": "RTO",
"correct_phone_number": "",
"correct_address": "",
"future_delivery_date": "13/08/2021",
"seller_remarks": ""
},
{
"awb": "742078894490",
"ndr_action": "RTO",
"correct_phone_number": "",
"correct_address": "",
"future_delivery_date": "13/08/2021",
"seller_remarks": ""
}
],
"err_awbs": [
{
"awb": "742082577960",
"ndr_action": {
"err": "RAk is not a valid action.",
"value": "RAk"
},
"correct_phone_number": {
"err": "phone number should be exactly 10 digits.",
"value": "900909090909"
},
"correct_address": "dfadf-1234 dkfjal 111001",
"future_delivery_date": {
"err": "the date 12/7/2021 is not a future date",
"value": "12/7/2021"
},
"seller_remarks": ""
},
{
"awb": "742082568930",
"ndr_action": "RTO",
"correct_phone_number": "",
"correct_address": "",
"future_delivery_date": {
"err": "Future Delivery Date can be maximum 15 days in future",
"value": "22/10/2021"
},
"seller_remarks": ""
},
{
"awb": "742082504305",
"ndr_action": "RTO",
"correct_phone_number": {
"err": "phone number should contain numbers only",
"value": "jabdjhbdas"
},
"correct_address": "",
"future_delivery_date": {
"err": "Future Delivery Date can be maximum 15 days in future",
"value": "22/10/2021"
},
"seller_remarks": ""
},
{
"awb": "742082485055",
"ndr_action": "RTO",
"correct_phone_number": "",
"correct_address": {
"err": "Customer Address exceeds limit of 60 characters",
"value": "sdfsfbsdfbnsdubfiusdbifbsiubfisbnfiubsiufbisubfisbfbsibsbvlssfjsbkljnvhbisunbvnhcbliundslfndskn"
},
"future_delivery_date": {
"err": "Customer Address exceeds limit of 60 characters",
"value": "13/08/2021"
},
"seller_remarks": ""
}
]
}'
Response:
{
"sucs_awbs_count": 302,
"err_awbs": [
{
"awb": "742082577960",
"ndr_action": {
"err": "RAk is not a valid action.",
"value": "RAk"
},
"correct_phone_number": {
"err": "phone number should be exactly 10 digits.",
"value": "900909090909"
},
"correct_address": "dfadf-1234 dkfjal 111001",
"future_delivery_date": {
"err": "the date 12/7/2021 is not a future date",
"value": "12/7/2021"
},
"seller_remarks": ""
},
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.