function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Semira@gmail.comSemira@gmail.com 

Help with understanding API's and Web services

Hello, 

I was asked to take a stab at implementing another system with Salesforce which will pull information from Salesforce Opportunity object into their mobile app. Since this is my very first time working with API's, I'm extremely lost on where to start. 

I read bunch of articles and the developer guide to understand the different API's and their use. However, my confusing is on what the first step is, I should be taking.

Problems or task at hand: We are looking at a mobile Timecard application, where users will use the app to login and pull up a Opportunity record (I'm guessing this is just the name of opportunity) and stamp their time to clock in and out of a job. I was provided with their TimeCard SOAP API documentation to take a look at the api's and the library. 

Questions
1. What is the first step should I be doing? (If I'm not wrong, I believe we will also be updating few fields on Opportunity after they have entered their time to clock in or out. If not Oppostunity record, then related object to Opportunity) 
2. What questions should I be asking them (the developer from Timecard app)? 
3. Do I write a webservice, generate Apex WSDL and give it to them? (Assuming data needs to go from Salesforce to their system)
4. I don't have any experience in .NET, do I need to? 
5. Why do I need to look at their API documentation? Are they assuming that I will be writing code on their end? Again, going back what should I be asking them? How does this usually work?
6. What do I do with the WSDL file when they give me their, if they do (steps by steps)? 

As you can tell I have never worked with webservices and api's but I think this is a very good opportunity for me to learn hands on and work with it. Even though it is very short amount of time to soak everything up, I am hoping someone will guide me to the right direction. Also, I do not have any mentor or go to person to ask since I'm the solo Salesforce person working here. SO, I will be needing lots of help. Any guidance will be truly appreciated! 

Thank you. 
Best Answer chosen by Semira@gmail.com
Laxman Vattam 26Laxman Vattam 26
There are multiple ways to handle this depending on exact requirements:
First way: You can download WSDL from Salesfore and provide it to other team (mobile app team). Using WSDL provided, they can directly query required information from Salesforce. Also, they can directly update the data in Salesforce
Second way: You can expose APEX functionality on Salesforce using REST API. Please refer sample code for REST API below:
https://yoursalesforceguide.blogspot.com/2016/12/exposing-apex-functionality-through.html
https://yoursalesforceguide.blogspot.com/2016/12/calling-external-rest-service-from.html
Third way: You can get WSDL provided by other team and convert it to APEX class in Salesforce. You need to tweak the class generated to do the needful

1. What is the first step should I be doing? (If I'm not wrong, I believe we will also be updating few fields on Opportunity after they have entered their time to clock in or out. If not Oppostunity record, then related object to Opportunity) 
See if First Way works for them by directly querying/updating salesforce data
2. What questions should I be asking them (the developer from Timecard app)? 
Understand on how (what fields) they are going to query Salesforce
3. Do I write a webservice, generate Apex WSDL and give it to them? (Assuming data needs to go from Salesforce to their system)
First/Second way should work
4. I don't have any experience in .NET, do I need to? 
No
5. Why do I need to look at their API documentation? Are they assuming that I will be writing code on their end? Again, going back what should I be asking them? How does this usually work?
6. What do I do with the WSDL file when they give me their, if they do (steps by steps)? 
You need to convert to APEX class. If you click on APEX classes, there is an option 'Generate from WSDL' that will consume WSDL and convert to Apex

I hope this above information gave you some idea to get started.

All Answers

Laxman Vattam 26Laxman Vattam 26
There are multiple ways to handle this depending on exact requirements:
First way: You can download WSDL from Salesfore and provide it to other team (mobile app team). Using WSDL provided, they can directly query required information from Salesforce. Also, they can directly update the data in Salesforce
Second way: You can expose APEX functionality on Salesforce using REST API. Please refer sample code for REST API below:
https://yoursalesforceguide.blogspot.com/2016/12/exposing-apex-functionality-through.html
https://yoursalesforceguide.blogspot.com/2016/12/calling-external-rest-service-from.html
Third way: You can get WSDL provided by other team and convert it to APEX class in Salesforce. You need to tweak the class generated to do the needful

1. What is the first step should I be doing? (If I'm not wrong, I believe we will also be updating few fields on Opportunity after they have entered their time to clock in or out. If not Oppostunity record, then related object to Opportunity) 
See if First Way works for them by directly querying/updating salesforce data
2. What questions should I be asking them (the developer from Timecard app)? 
Understand on how (what fields) they are going to query Salesforce
3. Do I write a webservice, generate Apex WSDL and give it to them? (Assuming data needs to go from Salesforce to their system)
First/Second way should work
4. I don't have any experience in .NET, do I need to? 
No
5. Why do I need to look at their API documentation? Are they assuming that I will be writing code on their end? Again, going back what should I be asking them? How does this usually work?
6. What do I do with the WSDL file when they give me their, if they do (steps by steps)? 
You need to convert to APEX class. If you click on APEX classes, there is an option 'Generate from WSDL' that will consume WSDL and convert to Apex

I hope this above information gave you some idea to get started.
This was selected as the best answer
Semira@gmail.comSemira@gmail.com
Thank you very much. This is exactly what I was looking for. Also, I looked up the OAuth and understood why it is needed. It was very helpful to understnad the steps from there. 
Prateek SinghPrateek Singh

Laxman has explained it very nicely. I hope you were succesfully able to achieve the task . But if in case you will need to work on Integration regularly then I will highly recommend taking this course http://courses.getskillsfast.com/courses/complete-salesforce-integration-course

Brooke HarperBrooke Harper
I agree with Prateek that Laxman explained it in great detail. I'm also hoping that this worked well for you! Thanks to Prateek for the course too, I find it very useful.
MahmudkMahmudk
I would also add to Laxman recommedation. Look into outbound messaging, instead of pulling data from salesforce, let's salesforce trigger when to post data to an End-Points ( Web services). If that fits in your scenerio.
zabee saqibizabee saqibi

I agree with Prateek that Laxman explained it in great detail. I'm also hoping that this worked well for you! Thanks to Prateek for the course too, I find it very useful.
https://www.mskwrites.com/urdu-sad-shayari