דברים שכדאי לדעת על Salesforce API

סביבת Salesforce מספקת שלושה פרוטוקולים המאפשרים לאנשי פיתוח ליצור חיבוריות בין מערכות חיצוניות לבין Salesforce. המפתחים שלנו אספו את המידע המועיל הבא אודות הפרוטוקולים (API) הללו וחשבנו לשתף בו אתכם:

Soap API

Use SOAP API to create, retrieve, update or delete records, such as accounts, leads, and custom objects. With more than 20 different calls, SOAP API also allows you to maintain passwords, perform searches, and much more. Use SOAP API in any language that supports Web services.

Rest API

REST API provides a powerful, convenient, and simple REST-based Web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it’s an excellent choice of technology for use with mobile applications and Web projects. However, if you have a large number of records to process, you may wish to use Bulk API, which is based on REST principles and optimized for large sets of data.

Bulk API

Bulk API is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, insert, update, upsert, or delete a large number of records asynchronously by submitting batches which are processed in the background by Salesforce.

לכל אחד מהפרוטוקולים הללו יש מגבלות שכדאי להכיר אם אתם רוצים לפתח עבורו. המגבלות כולן, גם ספציפית לגבי ה-API וגם בכל סביבת Salesforce, נמצאות במסמך הבא באתר שלהם. בתחתית עמוד 36 תמצאו מידע חשוב אודות ה-SOAP API. הנה כמה דברים חשובים שאספנו מהחלק הזה:

– Your client application can add up to 200 records in a single create() call. If a create request exceeds 200 objects, then the entire operation fails.

– Your client application can change up to 200 records in a single update() call. If an update request exceeds 200 records, then the entire operation fails.

– The login request size is limited to 10 KB or less.

– By default, the number of rows returned in the query result object (batch size) returned in a query() or queryMore() call is set to 500. WSC clients can set the batch size by callingsetQueryOptions() on the connection object. C# client applications can change this setting by specifying the batch size in the call QueryOptions portion of the SOAP header before invoking the query() call. The maximum batch size is 2,000 records. However this setting is only a suggestion. There is no guarantee that the requested batch size will be the actual batch size. This is done to maximize performance. The batch size will be no more than 200 if the SOQL statement selects two or more custom fields of type long text. This is to prevent large SOAP messages from being returned.

המגבלות הנוגעות ל-BULK API קצת שונות ותוכלו למצוא אותם בעמוד 35 של המסמך. הנה כמה דוגמאות משם:

– A batch can contain a maximum of 10,000 records

המגבלות הנוגעות למספר המקסימלי של קריאות API שניתן להשתמש בהן בפרק זמן של 24 שעות נמצאות בעמוד 34. הערכים הללו נגזרים מסוג המהדורה שאתם משתמשים בה. כך למשל:

– the minimum API calls in 24 hours limit for editions professional, enterprise and unlimited is 5000. This limit increases depending on the number of SF user licences.

אם אתם מפתחים או שוקלים לפתח יישומים המקושרים ל-Salesforce, נשמח לסייע לכם. צרו קשר.