Skip to main content

API reference V2

API v2

Pataa Address API is a fast and simple interface that allows you to quickly fetch the address and customer details against a Pataa code

Overview

Get Started

  1. Get your API Key
  2. Checkout the wrapper for your preferred language.
  3. Or start using the address API directly

Getting the user details using Pataa Code

Resource URL

MethodURLPlatform
POSThttps://apiv2.pataa.com/get-pataa-webWeb
POSThttps://apiv2.pataa.com/get-pataa-iosiOS
POSThttps://apiv2.pataa.com/get-pataa-androidAndroid

Parameters for web

KeyRequired (yes/no)Description
api_keyyesAPI key a token genrated by the user on the dashboard and used to authenticate the api call
pcyespc stands for Pataa Code. It is alphanumeric value fed by the user to get details of associated address
device_typeyesdevice_type = web, should be written in small letters and there should be no white space.

Example Body : raw (json)

    {
"api_key":"777XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"pc":"KUMAR100",
"device_type": "web"
}

Parameters for android

KeyRequired (yes/no)Description
api_keyyesAPI key a token genrated by the user on the dashboard and used to authenticate the api call
pcyespc stands for Pataa Code. It is alphanumeric value fed by the user to get details of associated address
device_typeyesdevice_type = android, should be written in small letters and there should be no white space.
app_nameyesThe name of your app
package_nameyespackage name of your app
package_keyyesSHA-1 Key genrated from android studio

Example Body : raw (json)

    {
"api_key":"777XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"pc":"KUMAR100",
"device_type": "web",
"app_name": "helloworld",
"package_name":"helloworld.com",
"package_key":"xcvvvXXXXXXXXXXXXXXXXXXXX",
}

Parameters for iOS

KeyRequired (yes/no)Description
api_keyyesAPI key a token genrated by the user on the dashboard and used to authenticate the api call
pcyespc stands for Pataa Code. It is alphanumeric value fed by the user to get details of associated address
device_typeyesdevice_type = ios, should be written in small letters and there should be no white space.
app_nameyesThe name of your app
package_nameyesbundle id of your ios app
pacakge_keyyesprefix of your ios app

Example Body : raw (json)

    {
"api_key":"777XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"pc":"KUMAR100",
"device_type": "web",
"app_name": "helloworld",
"package_name":"helloworld.com",
"package_key":"xcvvvXXXXXXXXXXXXXXXXXXXX",
}
Tips
  • Always use HTTPS
  • Remember to send the required parameters as json in the body
  • Always include a valid API key in the parameters

Response on success

    {
"user": {
"first_name": "Aman",
"last_name": "Sohani",
"country_code": "+91",
"mobile": "77XXXXXXXX",
"email_id": ""
},
"pataa": {
"address1": "100, JV Bhole Road",
"address2": "Opp. Agar Bazaar",
"address3": "Near Siddhivinayak Temple",
"address4": "Dadar West",
"zipcode": "400002",
"pataa_code": "KUMAR100",
"city_name": "Mumbai",
"state_name": "Maharashtra",
"address_category": "Home",
"country_name": "India",
"share_link": "https://pataa.com/share/#/?pc=40599XJL8WTZYIG&access_key=FXXGUY9FLLCKDTZFP3ML",
"qr_code": "https://app.pataa.com/g8VH"
},
"pc_img": [],
"landmarks": []
}

Response when using a drone pataa code

    {
"user": {
"first_name": "Aman",
"last_name": "Sohani",
"country_code": "+91",
"mobile": "77xxxxxxx",
"email_id": ""
},
"pataa": {
"address1": "Kalandi Kunj",
"address2": "Bungalow No 5",
"address3": "Delhi",
"address4": "Near Metro Station",
"zipcode": "110085",
"pataa_code": "DRONE05",
"city_name": "North West delhi",
"state_name": "Delhi",
"address_category": "Home",
"country_name": "India",
"share_link": "https://pataa.com/share/#/?pc=40599XJL8WU8BDF&access_key=6UOLDGQN2X6ZH1K2SRS1",
"qr_code": "https://app.pataa.com/cR3YVSUteeEiHkqb7"
},
"pc_img": [],
"landmarks": []
}

Error Handling

You will get a 200 HTTP status code, if no error is found. If there is an error, such as an incorrect Pataa Code, you will get a http status code of 204 in the body of the response. The body will also contain an error block with a code and a message code that can be used programmatically, which will help you to respond appropriately. This Message is intended to help you fix, whatever went wrong.

Response when device_type=web and origin is different
    {
"status": 401,
"msg": "Seems like you are using the API key on a different Platform. Please check",
"message": "Unauthorized"
}
Response on API key is not valid
    {
"status": 400,
"msg": "Your key is deactivated please generate new.",
"error": "Bad Request"
}
Response on API key is inactive
    {
"status": 400,
"msg": "Invalid API key or App key,you are not authorized.Please provide a valid key",
"error": "Bad Request"
}

Response when the origin check fails
    {
"status": 401,
"msg": "Seems like you are using the API key on a different Platform. Please check",
"message": "Unauthorized"
}

Response when using the wrong device type
   {
"status": 400,
"msg": "Please check the all fields {app_name ,package_key,package_name }",
"error": "Bad Request"
}

Response when device type android or ios, app_name is missing
    {
"status": 400,
"msg": "Please check your device type {web,android,ios}",
"error": "Bad Request"
}
Response when device type is android or ios and other required parameters are missing
    {
"status": 400,
"msg": "Please check the all fields {app_name ,package_key,package_name }",
"error": "Bad Request"
}

Response on failure
   {
"status": 204,
"msg": "Pataa Code not found",
"message": "No Content"
}

Response when key is not published and you have exhausted 50 free hits limit
   {
"status": 400,
"msg": "Limit exceeded! Please recharge your account to continue with the services",
"error": "Bad Request"
}

Below is the list of all HTTP error codes. New error codes may be added in future.

CodeDescription
200Request Successful.
204There is no content to send for this request, but the headers may be useful.
401MissingKey or InvalidKey. Check you API key is supplied as key=[API-KEY].
50xInternal Server Error.