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
Imtiaz PashaImtiaz Pasha 

Hi all i want to give API's to the third party people , where they have intergrated connected app through salesforce oath how to provide them API'S to push the data anyidea ?

WEN JIEWEN JIE
Hi,

You could share them SFDC REST API for details.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest_resources.htm

Thanks
Imtiaz PashaImtiaz Pasha
i didnt get can you please guide me
WEN JIEWEN JIE
You only need to provide SFDC standard REST API, they will find how to call SFDC by API.
Imtiaz PashaImtiaz Pasha
for the custom field how to create the APIs.
WEN JIEWEN JIE
For customized object and corresponding fields, SFDC will generate metadata directly.
Imtiaz PashaImtiaz Pasha
okay got it , so that i can give them the end point API name to fetch the data
WEN JIEWEN JIE
Yes. They could get objct and corresponding fields API name by API. Or you could share these with them directly, then they only need to fouce on the logic part.
Imtiaz PashaImtiaz Pasha
okay got it.
Imtiaz PashaImtiaz Pasha
Hi Wen ,

I want to  Changes to existing REST API to support Lead creation from third party , that means Insert API , 

so third party asking me the API details for pushing the leads like authentication details , end point and sample request and response format. he is asking if possible please provide curl .. any idea can you help me on this ?
Imtiaz PashaImtiaz Pasha
Hi Wen Any Idea On this ?
WEN JIEWEN JIE
Hi Imtiza,

First, you need to create connect app for external integration system. Then share them Consumer Key and Consumer Secret.
Second, you need to create an integration account for them. (same as a general user). Assign the corresponding permission. (e.g. CRUD permission on Lead object.) Then share the username, password and security token to them.
Finally, based on these inforamtion they could call SFDC to get access token then insert record to Lead table.

Check this one : https://github.com/asagarwal/salesforce-rest-api-with-java/blob/master/salesforce_rest_api_2.java 

Thanks.
Imtiaz PashaImtiaz Pasha
Hi Wen,

I have done evrything they are able to access now , but problem is in the account object  , account name  they are not able fetch it, its showing error in the postman saying you do have access to field permission on your profile but i have given the permission
WEN JIEWEN JIE
Hi Imtiza,

Please also check field level security for account's fields. (read, write permission)

Thanks.
Imtiaz PashaImtiaz Pasha
yes thanks now he can fetch the details but invoice PDF link  he is not able to fetch that from Invoices , i have provided the parameter , you have any idea why is that ?
WEN JIEWEN JIE
Does the Invoices  is a customized sobject ? If yes, please also re-check object, and field permisison for the integration account profile.
Imtiaz PashaImtiaz Pasha
Yes customised ..but third party coudnt able to fetch PDF attachment which is generated in SF , third party doing from POstman to fetch that .

i check everything is fine , any idea on this
WEN JIEWEN JIE
I can't remember how to handle file by REST API. They could check from SFDC REST API document. 
Imtiaz PashaImtiaz Pasha
Okay Thanks Wen
WEN JIEWEN JIE
np~
Imtiaz PashaImtiaz Pasha
Hi Wen how to improve the test coverage bcz i did some changes in sandbox now i have to move this production but cove coverage 49% in sandbox and in production its 63% , please help me i want deploy the  code today
WEN JIEWEN JIE
Hi Imtiza,

Just saw your message. Hope you have improved your test coverage. Try to cover all logic with test data.