Library needed
1. Curl
Common Parameters for all API calls
All the API call require payal account information.So we can save these details in an array as follows.
Common Functions
The following functions are common for all API calls.
Steps to generate Custom Reports
1.The parameters needed for generating a custom report are 'start_date' and 'end_date'.So we can save the parameters in an array as follows.
2.Now we can run the report request as follows.
Here the second parametes is the name of the report.To generate another report we just need to change the report name and give the corresponding parameters in the parameter array.Remeber to give parameter names as keys of parameter array.
3.We will get reportId if the above Api call is successful.We can parse the response from above call and get reportId as follows.
4. Request for the results.
5.Now we can get all the fields in the report.
We can arrange the field names in an array using the function GenerateFieldArray().
6.Finally we can get data for our report.
Now we just need to display it in a report format.