4.9 KiB
4.9 KiB
CURL Command for Testing addCompanyDetails Lambda
Prerequisites
- Replace
YOUR_API_URLwith your actual API Gateway URL - Replace
YOUR_AUTH_TOKENwith a valid JWT token - Replace file paths with actual document files on your system
Form Data Structure
The endpoint expects:
companyDetails: JSON string containing company informationdocuments: JSON string containing array of document metadata- File fields: One file field per document (e.g.,
panFile,gstFile, etc.)
CURL Command
curl -X POST "YOUR_API_URL/minglaradmin/add-company-details" \
-H "x-auth-token: YOUR_AUTH_TOKEN" \
-F "companyDetails={\"companyName\":\"Test Company\",\"hostRefNumber\":\"HOST001\",\"address1\":\"123 Main St\",\"address2\":\"Suite 100\",\"cityXid\":1,\"stateXid\":1,\"countryXid\":1,\"pinCode\":\"12345\",\"isSubsidairy\":false,\"registrationNumber\":\"REG123456\",\"panNumber\":\"ABCDE1234F\",\"gstNumber\":\"27ABCDE1234F1Z5\",\"formationDate\":\"2020-01-01\",\"companyType\":\"Private Limited\",\"currencyXid\":1}" \
-F "documents=[{\"documentTypeXid\":1,\"documentName\":\"pan.pdf\",\"fieldName\":\"panFile\"},{\"documentTypeXid\":2,\"documentName\":\"gst.pdf\",\"fieldName\":\"gstFile\"},{\"documentTypeXid\":3,\"documentName\":\"registration.pdf\",\"fieldName\":\"registrationFile\"},{\"documentTypeXid\":4,\"documentName\":\"aadhaar.pdf\",\"fieldName\":\"aadhaarFile\"}]" \
-F "panFile=@/path/to/pan.pdf" \
-F "gstFile=@/path/to/gst.pdf" \
-F "registrationFile=@/path/to/registration.pdf" \
-F "aadhaarFile=@/path/to/aadhaar.pdf"
Example with Real Values
curl -X POST "https://abc123.execute-api.ap-south-1.amazonaws.com/minglaradmin/add-company-details" \
-H "x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-F "companyDetails={\"companyName\":\"Acme Corp\",\"hostRefNumber\":\"HOST001\",\"address1\":\"123 Business Park\",\"address2\":\"Building A\",\"cityXid\":1,\"stateXid\":1,\"countryXid\":1,\"pinCode\":\"400001\",\"isSubsidairy\":false,\"registrationNumber\":\"U12345MH2020PTC123456\",\"panNumber\":\"ABCDE1234F\",\"gstNumber\":\"27ABCDE1234F1Z5\",\"formationDate\":\"2020-01-15\",\"companyType\":\"Private Limited\",\"websiteUrl\":\"https://acme.com\",\"currencyXid\":1}" \
-F "documents=[{\"documentTypeXid\":1,\"documentName\":\"pan-certificate.pdf\",\"fieldName\":\"panFile\"},{\"documentTypeXid\":2,\"documentName\":\"gst-certificate.pdf\",\"fieldName\":\"gstFile\"},{\"documentTypeXid\":3,\"documentName\":\"registration-certificate.pdf\",\"fieldName\":\"registrationFile\"},{\"documentTypeXid\":4,\"documentName\":\"aadhaar.pdf\",\"fieldName\":\"aadhaarFile\"}]" \
-F "panFile=@./documents/pan.pdf" \
-F "gstFile=@./documents/gst.pdf" \
-F "registrationFile=@./documents/registration.pdf" \
-F "aadhaarFile=@./documents/aadhaar.pdf"
Postman Setup
- Method: POST
- URL:
YOUR_API_URL/minglaradmin/add-company-details - Headers:
x-auth-token:YOUR_AUTH_TOKEN
- Body: Select
form-data - Add Fields:
companyDetails(Text): JSON string with company detailsdocuments(Text): JSON array string with document metadatapanFile(File): Select PDF filegstFile(File): Select PDF fileregistrationFile(File): Select PDF fileaadhaarFile(File): Select PDF file
Required Document Types
Based on REQUIRED_DOC_TYPES:
documentTypeXid: 1- PANdocumentTypeXid: 2- GSTdocumentTypeXid: 3- REGISTRATIONdocumentTypeXid: 4- AADHAAR
Company Details JSON Structure
{
"companyName": "string (required)",
"hostRefNumber": "string (required)",
"address1": "string (required)",
"address2": "string (optional)",
"cityXid": "number (required)",
"stateXid": "number (required)",
"countryXid": "number (required)",
"pinCode": "string (required, min 4 chars)",
"logoPath": "string (optional)",
"isSubsidairy": "boolean (required)",
"registrationNumber": "string (required)",
"panNumber": "string (required)",
"gstNumber": "string (optional)",
"formationDate": "string (required, ISO date)",
"companyType": "string (required)",
"websiteUrl": "string (optional, must be valid URL)",
"instagramUrl": "string (optional, must be valid URL)",
"facebookUrl": "string (optional, must be valid URL)",
"linkedinUrl": "string (optional, must be valid URL)",
"twitterUrl": "string (optional, must be valid URL)",
"currencyXid": "number (required)"
}
Documents JSON Structure
[
{
"documentTypeXid": 1,
"documentName": "pan.pdf",
"fieldName": "panFile"
},
{
"documentTypeXid": 2,
"documentName": "gst.pdf",
"fieldName": "gstFile"
}
]
Notes
- All 4 required document types (PAN, GST, REGISTRATION, AADHAAR) must be provided
- File field names in the
documentsarray must match the form field names - Files can be PDF, images, or any other document type
- The endpoint supports both
multipart/form-dataand JSON (for backward compatibility)