Integrating the Vedic Astrology PDF API

This article guides you through integrating and testing the Vedic Astrology PDF API using Postman, allowing for the generation of detailed Vedic reports, complete with your branding.

 Last updated : 15 Jun, 2024
 Guide

Prerequisites

  • A Divine API Account: Ensure you're signed up at reports.divineapi.com to access the dashboard and retrieve your API keys.
  • Test API Key: Available in your dashboard, this key permits generating a limited number of test PDF reports for validation purposes. 
  • Live report generation requires transitioning to paid reports post successful testing.

Step 1: Importing the Postman Collection

Ease your integration process by leveraging our ready-made Postman collection:

  • Access Your Dashboard: Sign in to your Divine API account and head to the dashboard.
  • Find the Postman Collection Link: Look for the direct link to our Postman collection tailored for our API services.
  • Import into Postman: Use the link to import the collection into Postman, complete with pre-configured request setups and endpoints.

Step 2: Configuring the Request

Choose from multiple endpoints based on the report type required:

  • Kundali Reports:
    • Sampoorna: https://pdf.divineapi.com/indian-api/v1/kundali-sampoorna
    • Ananta: https://pdf.divineapi.com/indian-api/v1/kundali-ananta
    • Prakash: https://pdf.divineapi.com/indian-api/v1/kundali-prakash
  • Kundali Matching: https://pdf.divineapi.com/indian-api/v1/match-making
  • Specialized Reports:
    • Government Job Report: https://pdf.divineapi.com/indian-api/v1/government-job-report
    • Foreign Travel & Settlement: https://pdf.divineapi.com/indian-api/v1/foreign-travel-settlement
  • Vedic Yearly Predictions:
    • 5-Year: https://pdf.divineapi.com/indian-api/v1/vedic-yearly-prediction-5-year
    • 10-Year: https://pdf.divineapi.com/indian-api/v1/vedic-yearly-prediction-10-year
    • 15-Year: https://pdf.divineapi.com/indian-api/v1/vedic-yearly-prediction-15-year

Select the appropriate endpoint based on the report type and set the method to POST.

Step 3: Setting Up Authorization

Secure your API calls:

  • Navigate to the Authorization tab in Postman.
  • Select Bearer Token as the type.
  • Input your Bearer Token in the designated field.

Note: You will find the Bearer token in your Dashboard along with the Live & Test keys

Step 4: Configuring the Request Body

In the body of your request, select raw and choose JSON as the format. Then, input the following parameters:

{

 "api_key": "your API Key",

 "full_name": "Rahul Kumar",

 "day": "01",

 "month": "12",

 "year": "1998",

 "hour": "21",

 "min": "55",

 "sec": "30",

 "gender": "male",

 "place": "New Delhi, India",

 "lat": "28.7041",

 "lon": "77.1025",

 "tzone": "5.5",

 "lan": "en",

 "company_name": "Divine API",

 "company_url": "https://divineapi.com/",

 "company_email": "admin@divineapi.com",

 "company_mobile": "+91 9557787052",

 "company_bio": "Discover the best Horoscope API and Tarot API services at Divineapi.com...",

 "logo_url": "https://divineapi.com/assets/logo.png",

 "footer_text": "Divine API"

}

4.1 Explanation of Body Parameters

  • api_key: Your unique API key for accessing the service. This key authenticates your requests to ensure security and proper access control.
  • full_name: The full name of the individual for whom the report is being generated. This is used to personalize the report.
  • day: The birth day of the individual, used to calculate specific astrological details. Format as a two-digit number (e.g., "01").
  • month: The birth month of the individual. This should be formatted as a two-digit number (e.g., "12") and is crucial for accurate astrological analysis.
  • year: The birth year of the individual, essential for creating the natal chart and performing accurate astrological calculations.
  • hour: The hour of birth, based on a 24-hour clock, used to determine the ascendant and other time-sensitive aspects of the natal chart.
  • min: The minute of birth, which helps refine the accuracy of the astrological predictions and calculations.
  • sec: The second of birth, providing even further precision for the astrological analysis, though not always required.
  • gender: The gender of the individual ("male" or "female"). Some astrological analyses might differentiate interpretations based on gender.
  • place: The birthplace (city, state, country) of the individual. This information is used to calculate the local sidereal time and hence the ascendant.
  • lat: The latitude of the birthplace, essential for calculating the precise position of celestial bodies at the time of birth.
  • lon: The longitude of the birthplace, used alongside latitude to accurately calculate the astrological chart.
  • tzone: The time zone of the birthplace, represented as a decimal (e.g., "5.5" for IST). This is critical for adjusting the birth time to GMT for accurate chart calculations.
  • lan: Language code for the report (e.g., "en" for English). This determines the language in which the report is generated.
  • company_name: Your company's name. This allows for branding of the report with your business name.
  • company_url: Your company's website URL. This can be included in the report for brand visibility and credibility.
  • company_email: The contact email for your company. This might be used for customer inquiries or support related to the report.
  • company_mobile: Your company's contact mobile number, providing another avenue for customer contact or support.
  • company_bio: A short bio or description of your company. This is a branding opportunity to share more about your services.
  • logo_url: The URL of your company logo. This image will be included in the report for branding purposes.
  • footer_text: Custom text to appear in the footer of each page of the report. This can be used for copyright notices, contact information, or promotional messages.

API Keys

Within your dashboard, you will find two types of API keys:

  • Production API Key: Use this key for all live requests once you're ready to integrate our service into your application.
  • Test API Key: This key allows you to generate up to 15-20 test PDF reports to ensure the integration works as expected without affecting your quota or incurring costs.

Branding Options

The request body includes branding options allowing you to customize the PDF reports with your company's identity:

  • company_name: Your company's name.
  • company_url: Your company's website URL.
  • company_email: Your contact email.
  • company_mobile: Your contact mobile number.
  • company_bio: A short bio or description of your company.
  • logo_url: The URL of your company logo.
  • footer_text: Custom text to appear in the footer of each page.

Step 5: Sending the Request

After configuring your request, click the "Send" button. You should receive a response similar to the following:

{

 "success": 1,

 "data": {

 "name": "Rahul Kumar",

 "report_url": "https://reports.divinestore.net/r/1133717091112331546726-52"

 

}5.1 Response Body Explained

  • success: Indicates the request was successful (1 = success).
  • data: Contains the report details.
    • name: The name of the individual the report pertains to.
    • report_url: The URL where the generated report can be accessed.

Conclusion

This guide assists in the seamless integration and testing of the Vedic Astrology PDF API using Postman. Tailor your offerings with personalized, branded astrology reports, enhancing your service value. For additional support, our customer service team is ready to assist.