Add functionality to a currently existing web service
1. I need to know exacly what files are being used for the API, as far as I understand they are public_html/aviral.me/auto/wp-content/plugins/wm-soap/soap.php and public_html/aviral.me/auto/wp-content/plugins/wm-soap/wsdls/wm-soap.wsdl
If any other files are affected or changed I need to know as well, or else please confirm that only these are affected.
2. I need to know what I need to do to make this work on a separate URL. As far as I currently know, I need to change "http://aviral.me/auto/" to "http://my-website.com/custom-directory/" in all instances on the wm-soap.wsdl file. Please tell me if any other change is required to make this work on a different URL, and if what I know is correct, please confirm with an affirmative.
1) the createUser function and the createAdvertisement function have been merged by me into a single function called createUserAdvertisement, so as to reduce the load on XenCall software.
2) I don't see any way to retrieve a password when an advertisement is created -
if a temp password is emailed to the advertiser's email, then I didn't receive that email on testing(normally XenCall system will build the greeting email and send it along with the temp password, once the API post is complete.)
Here's my solution.
If you see the code created by your developer in wm-soap.php, you can see
$random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );
the standard code for random pass generation.
So to combat this issue with the existing API, If the create[User]Advertisement function(s) could return this random password, or allow us to specify an initial password (by creating another input variable through the API), it would solve this problem.
3) We will need an API function to update the details of an existing listing custom post type. Let me explain. The listings on this website are using a custom post type called Listing, a new post of which is created on calling the createAdvertisement function. Basically, when an interested buyer calls the website call center we would use the createUserAdvertisement function after getting money from the sale, to create a user account of our new customer on the site, and to create a listing for is car that he needs to sell.
Now what if he calls us tomorrow to change some details? We need a function to be able to edit any current listing post using the API. The create user function by your developer already returns the adID as I can already see a line that says:
$data['adId'] = $post_ID;
XenCall people will use their CRM database to store these adIDs that the API returns so we don't need to care about that.
So all that needs to be done is that taking the input of a function as 'adId', an API function needs to be created that takes the SAME inputs as createAdvertisement functions.
4) THIS IS OPTIONAL as I hadnt discussed about it but is a very easy thing to do so if you can do it in the specified budget I'll be glad. The previous developer made the API such that the "sold" is always marked unchecked for a new listing. I would like the new function in point 3 to have another input called "sold" which can take input like yes or no, true or false, 0 or 1, so that we can use the API to mark a listing as sold.
Just to make things clear, all inputs for createUserAdvertisement and the new function for editing ads, need to accept empty inputs too. For example, I might not have to add/edit all details to a listing and might just want to add/edit the price or the drivetrain, or only the sold status, in that case if I only provide some inputs and do not provide the remaning inputs, the functions should still work and not work ONLY if all of the 30 or so inputs are provided to create a listing, or to modify a listing by using new function mentioned in point 3.