Upload
bulk_verification.upload(BulkVerificationUploadParams**kwargs) -> BulkVerificationUploadResponse
POST/v1/addver_lists
Upload a CSV file of addresses to be verified in bulk. Supply a mappings
object describing which CSV columns correspond to which address fields.
Parameters
default_country: Optional[str]
An ISO 2-letter country code used as the fallback when a row is missing a
value in the country column.
Whether to run CCOA (Canada Post change of address) on the list. Note that a list cannot run both NCOA and CCOA — split mixed US/Canadian files into separate lists.
Whether to append geographical location information (latitude, longitude) to your output. Bulk geocoding must be enabled by contacting support.
Upload
import os
from postgrid import PostGrid
client = PostGrid(
address_verification_api_key=os.environ.get("POSTGRID_ADDRESS_VERIFICATION_API_KEY"), # This is the default and can be omitted
)
response = client.bulk_verification.upload(
file=b"Example data",
mappings={
"line1": "line1"
},
name="name",
)
print(response.data){
"data": {
"id": "id",
"cost": 0,
"count": 0,
"createdAt": "2019-12-27T18:11:19.117Z",
"file": "file",
"mappings": {
"line1": "line1",
"city": "city",
"country": "country",
"firstName": "firstName",
"fullName": "fullName",
"lastName": "lastName",
"line2": "line2",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState"
},
"name": "name",
"organization": "organization",
"status": "status",
"updatedAt": "2019-12-27T18:11:19.117Z",
"useGeocode": true,
"useIntlVerification": true,
"useProperCase": true,
"user": "user",
"defaultCountry": "defaultCountry",
"metadata": {
"statusCount": {
"corrected": 0,
"failed": 0,
"verified": 0
}
},
"numInvalidRows": 0,
"result": "result",
"runCCOA": true,
"runNCOA": true
},
"message": "message",
"status": "success"
}Returns Examples
{
"data": {
"id": "id",
"cost": 0,
"count": 0,
"createdAt": "2019-12-27T18:11:19.117Z",
"file": "file",
"mappings": {
"line1": "line1",
"city": "city",
"country": "country",
"firstName": "firstName",
"fullName": "fullName",
"lastName": "lastName",
"line2": "line2",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState"
},
"name": "name",
"organization": "organization",
"status": "status",
"updatedAt": "2019-12-27T18:11:19.117Z",
"useGeocode": true,
"useIntlVerification": true,
"useProperCase": true,
"user": "user",
"defaultCountry": "defaultCountry",
"metadata": {
"statusCount": {
"corrected": 0,
"failed": 0,
"verified": 0
}
},
"numInvalidRows": 0,
"result": "result",
"runCCOA": true,
"runNCOA": true
},
"message": "message",
"status": "success"
}