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
Baylor PeakBaylor Peak 

API created records?

Hello all,

I have a user who is consistently making API calls to Salesforce, but I am unable to figure out what records he is creating. Under his Contact, he has 0 records, yet he is making several API calls to Salesforce on a daily basis.

Is there a way to query on whether or not a record was generated from an API call from an external system?

Regards,
Baylor Peak
Raj VakatiRaj Vakati
It is easy to find .. 

Can you check with which user name he is login into the salesforce?  It will create the record with API logged user  

Check is there Code or process is updating the owner in case if the record is created from the api call .. so that the record is not with the same owner  ( In this case .. you can  query the data based on the created by field )

 
Naren9Naren9
Hi Baylor,
Since the records are injected into the Salesforce via API, the Legacy System/External System will be obviously using a User Account (API Enabled, say X) to actually login to Salesforce via the API and inject the records to the SF Database. So looking the Audit Fields (CreatedBy) could help us to identify if the record was created via API or not. In other words if the CreatedBy field says ‘X’ then we can assure that it was created as result of an API call.

Check this Link: https://help.salesforce.com/articleView?id=000176281&type=1
Check how many users are having API Enabled option and query records with CreatedBy = That user id.
Check also, updated By field also.

Thanks,
Naren
 
Baylor PeakBaylor Peak
Ok so yes, their is only one User with the SOAP Enterprise API logins per his login history - User X. I had already checked CreatedBy, LastModifiedBy, and LastModifiedDate, and found (I think) he is creating records via a Custom Object and I believe I found those records. That said, I want to be sure and as you suggested, I was already correlating the CreatedBy ID in those records with the same ID as User X. However, User X is also updating Contact records, primarily updating first and last Names of several contacts. Is User X also doing that via API?
Naren9Naren9
Hi Baylor,
A Record can be updated by many ways (Apex DML, Data Loader, Process Builder, Workflow etc...)  and API is one of them.
In the below article, you can find how many ways a record can be updated.
https://help.salesforce.com/articleView?id=000205468&type=1


Thanks,
Naren