Praxis Academy
Home › Platform Integration Architect › Build Solution

Platform Integration Architect practice questions: Build Solution

Build Solution is 23% of the Salesforce Certified Platform Integration Architect exam. It covers API limits, callouts, retries, idempotency, Bulk API and event delivery. Try these 17 free questions, then open each answer to see why every option is right or wrong.

01

A logistics company needs to notify its warehouse system through a REST callout whenever a Shipment__c record is inserted. The developer added the callout directly to an after insert trigger, and inserts now fail with a CalloutException. Which approach should the architect recommend?

  1. Move the callout into a before insert trigger so it runs before the DML is committed.
  2. Wrap the callout in a Continuation object invoked from the trigger handler.
  3. Enqueue a Queueable class that implements Database.AllowsCallouts and pass it the new record Ids.
  4. Add the warehouse endpoint to Remote Site Settings so the trigger is allowed to call it.
Show answer

Answer: C

A. Move the callout into a before insert trigger so it runs before the DML is committed.Callouts are not allowed from any trigger context synchronously, before or after, so changing the trigger event does not help.
B. Wrap the callout in a Continuation object invoked from the trigger handler.Continuation is designed for Visualforce, Aura and LWC controllers, not for trigger contexts.
C. Enqueue a Queueable class that implements Database.AllowsCallouts and pass it the new record Ids. ✓Correct. Triggers cannot make synchronous callouts, so the callout must run asynchronously; a Queueable that implements Database.AllowsCallouts runs after the transaction commits.
D. Add the warehouse endpoint to Remote Site Settings so the trigger is allowed to call it.Remote Site Settings authorize the endpoint but do not lift the restriction on synchronous callouts from triggers.

Why: Apex triggers cannot perform synchronous callouts. Move the callout to asynchronous Apex, such as a Queueable implementing Database.AllowsCallouts or an @future(callout=true) method.

02

A manufacturer integrates Salesforce with a supplier portal that uses the OAuth 2.0 client credentials flow. A developer currently stores the client ID and secret in a custom setting and builds the token request in Apex. What should the architect recommend instead?

  1. Configure an External Credential with the OAuth 2.0 client credentials protocol and reference it from a Named Credential used in the callout.
  2. Move the client secret into a protected custom metadata type and keep the Apex token logic.
  3. Store the client secret in an encrypted custom field on a dedicated configuration record.
  4. Create a Remote Site Setting for the token endpoint and hardcode the secret in a private static variable.
Show answer

Answer: A

A. Configure an External Credential with the OAuth 2.0 client credentials protocol and reference it from a Named Credential used in the callout. ✓Correct. Named Credentials with External Credentials store secrets securely, obtain and refresh tokens automatically, and let Apex call the endpoint with the callout: syntax.
B. Move the client secret into a protected custom metadata type and keep the Apex token logic.Protected metadata hides the value from subscribers, but the team still has to write and maintain token handling that the platform already provides.
C. Store the client secret in an encrypted custom field on a dedicated configuration record.Encrypted fields protect display, but the secret is still readable by Apex and token handling remains custom code.
D. Create a Remote Site Setting for the token endpoint and hardcode the secret in a private static variable.Hardcoding secrets in code is insecure and makes rotation require a deployment.

Why: Named Credentials, backed by External Credentials, are the recommended way to manage endpoints and authentication for callouts. The platform handles token retrieval and secret storage so code never touches credentials.

03

A telecom company uses a Queueable job to send provisioning requests to a network API. When the API is briefly unavailable, the job fails with an unhandled exception and the request is lost. The architect wants the platform to detect the failure and re-enqueue the work automatically. What should be implemented?

  1. A class implementing System.Finalizer, attached in the Queueable with System.attachFinalizer(), that re-enqueues the job when the result is UNHANDLED_EXCEPTION.
  2. A try-catch block in the Queueable that calls System.enqueueJob() for itself in the catch block.
  3. A scheduled flow that runs every hour and re-runs any Queueable that appears as Failed in AsyncApexJob.
  4. An @future method called from the Queueable's constructor to retry the request.
Show answer

Answer: A

A. A class implementing System.Finalizer, attached in the Queueable with System.attachFinalizer(), that re-enqueues the job when the result is UNHANDLED_EXCEPTION. ✓Correct. Transaction Finalizers run after the Queueable finishes, even when it fails, and can inspect the result and enqueue a retry.
B. A try-catch block in the Queueable that calls System.enqueueJob() for itself in the catch block.A catch block cannot handle uncatchable failures such as limit exceptions, and the same transaction may roll back; finalizers are the supported mechanism.
C. A scheduled flow that runs every hour and re-runs any Queueable that appears as Failed in AsyncApexJob.Polling for failures adds delay and custom bookkeeping, and the flow cannot easily rebuild the original job's state.
D. An @future method called from the Queueable's constructor to retry the request.The constructor runs in the enqueuing transaction before the job executes, so it cannot react to the job's failure.

Why: Transaction Finalizers let Queueable jobs run cleanup or retry logic after the job completes, whether it succeeded or failed, including on uncaught exceptions.

04

A platform event trigger on Payment_Received__e calls a downstream service through a Queueable, but first it must update a Payment__c record that is sometimes locked by another process. The architect wants the trigger to try the same batch again later when this transient lock error occurs. What should the trigger do?

  1. Catch the lock error and throw EventBus.RetryableException so the platform resends the batch to the trigger later.
  2. Catch the error and call EventBus.publish() to republish the same events.
  3. Let the DmlException propagate so the platform automatically retries the batch.
  4. Use FOR UPDATE in a SOQL query to wait indefinitely until the lock is released.
Show answer

Answer: A

A. Catch the lock error and throw EventBus.RetryableException so the platform resends the batch to the trigger later. ✓Correct. Throwing EventBus.RetryableException tells the platform to retry the trigger with the same batch of events after a delay, for a limited number of attempts.
B. Catch the error and call EventBus.publish() to republish the same events.Republishing creates new events with new replay IDs and can loop indefinitely without retry control.
C. Let the DmlException propagate so the platform automatically retries the batch.An ordinary uncaught exception does not trigger automatic retries; the failed events are not redelivered to the trigger.
D. Use FOR UPDATE in a SOQL query to wait indefinitely until the lock is released.FOR UPDATE waits only up to a short timeout and then throws an exception; it does not wait indefinitely.

Why: EventBus.RetryableException is the supported way to ask for a platform event trigger to be retried with the same events. Use it for transient errors such as record locks.

05

A developer publishes Invoice_Ready__e events with EventBus.publish() and checks each SaveResult. A tester asks whether isSuccess() returning true guarantees that the external subscriber has processed the event. How should the architect answer?

  1. No. A successful SaveResult means the event was accepted for publishing; delivery and processing by subscribers happen asynchronously afterward.
  2. Yes. EventBus.publish() waits for all subscribers to acknowledge the event before returning.
  3. Yes, but only when the event uses Publish After Commit behavior.
  4. No, because SaveResult is always true for platform events and errors are never reported.
Show answer

Answer: A

A. No. A successful SaveResult means the event was accepted for publishing; delivery and processing by subscribers happen asynchronously afterward. ✓Correct. The SaveResult confirms the publish request was queued; it does not report subscriber delivery or processing outcomes.
B. Yes. EventBus.publish() waits for all subscribers to acknowledge the event before returning.Publishing is asynchronous and decoupled; the publisher never waits for subscriber acknowledgment.
C. Yes, but only when the event uses Publish After Commit behavior.Publish behavior controls when the event is published relative to the transaction, not whether subscribers have processed it.
D. No, because SaveResult is always true for platform events and errors are never reported.Errors can be reported in SaveResult, for example when publishing fails or limits are exceeded.

Why: Platform events decouple publishers and subscribers. The SaveResult only reports whether the publish request was accepted; subscribers must implement their own processing confirmation if needed.

06

A bidirectional sync updates Salesforce Contacts from an HR system through an integration user, and the HR system also subscribes to ContactChangeEvent. Every update the HR system makes comes back to it as a change event, creating an update loop. What should the HR subscriber do?

  1. Ignore change events whose ChangeEventHeader.commitUser is the integration user's Id.
  2. Ignore change events whose changeType is UPDATE.
  3. Disable Change Data Capture on Contact while the integration runs.
  4. Filter by the transactionKey so only the first event of each transaction is processed.
Show answer

Answer: A

A. Ignore change events whose ChangeEventHeader.commitUser is the integration user's Id. ✓Correct. commitUser identifies the user who committed the change, so the subscriber can skip changes that it caused itself.
B. Ignore change events whose changeType is UPDATE.This would also drop legitimate updates made by Salesforce users.
C. Disable Change Data Capture on Contact while the integration runs.Disabling CDC would stop all change events, including the ones the HR system needs.
D. Filter by the transactionKey so only the first event of each transaction is processed.transactionKey groups events from the same transaction; it does not indicate who made the change.

Why: The commitUser header field records which user committed a change. Integrations can use it to recognize and skip echoes of their own updates and avoid loops.

07

A pharmaceutical company needs to notify a partner system when a clinical shipment is approved. The message must carry calculated values from several related objects and a status that is not stored on any single record. Which event mechanism is the best fit?

  1. A custom platform event with fields defined for the required payload, published when the approval completes.
  2. Change Data Capture on the shipment object with enrichment for related fields.
  3. An outbound message on the shipment object including the needed fields.
  4. A PushTopic on the shipment object with a SOQL query joining related objects.
Show answer

Answer: A

A. A custom platform event with fields defined for the required payload, published when the approval completes. ✓Correct. Platform events let you define a custom schema and publish exactly the business data the subscriber needs, independent of any single record.
B. Change Data Capture on the shipment object with enrichment for related fields.CDC reflects field changes on one object's records; enrichment adds fields from that record, not calculated values from several related objects.
C. An outbound message on the shipment object including the needed fields.Outbound messages carry fields from one object's record and cannot include calculated values from other objects.
D. A PushTopic on the shipment object with a SOQL query joining related objects.PushTopics are a legacy option and their queries cannot join several related objects or add calculated values.

Why: Use Change Data Capture to replicate record changes and custom platform events for business events with a custom payload. Platform events decouple the message from the data model.

08

A middleware platform sends customer records from an e-commerce system to Salesforce. When network errors occur, the middleware resends the same records, and duplicate Accounts are being created. Each customer has a unique ID in the e-commerce system. What should the architect recommend?

  1. Create a unique External ID field on Account for the e-commerce customer ID and have the middleware upsert on that field.
  2. Activate a duplicate rule on Account that blocks records with the same name.
  3. Have the middleware query Salesforce for each customer before deciding to insert or update.
  4. Disable retries in the middleware so records are never sent twice.
Show answer

Answer: A

A. Create a unique External ID field on Account for the e-commerce customer ID and have the middleware upsert on that field. ✓Correct. Upsert with an External ID matches existing records, so resending the same data updates the record instead of creating a duplicate, making the operation idempotent.
B. Activate a duplicate rule on Account that blocks records with the same name.Matching by name is unreliable and blocking duplicates causes errors instead of updating the existing record.
C. Have the middleware query Salesforce for each customer before deciding to insert or update.This doubles the API calls and still has race conditions between the query and the insert.
D. Disable retries in the middleware so records are never sent twice.Without retries, records that fail because of network errors would be lost.

Why: Upserting on an External ID makes integrations idempotent: the same message can be processed multiple times with the same result, which is essential when retries are possible.

09

A developer is writing a client that upserts two million Asset records into Salesforce with Bulk API 2.0. Which sequence of steps correctly describes the ingest job?

  1. Create the job with the object, operation and External ID field; upload the CSV data; set the job state to UploadComplete; poll the job until it finishes; then retrieve the successful and failed results.
  2. Create the job; split the data into batches of 10,000 records; add each batch; close the job; then query each batch's status.
  3. Upload the CSV to a Static Resource; create the job referencing the resource; then call the job's execute endpoint.
  4. Create the job; upload the data; Salesforce starts processing as soon as the first rows arrive; then retrieve results.
Show answer

Answer: A

A. Create the job with the object, operation and External ID field; upload the CSV data; set the job state to UploadComplete; poll the job until it finishes; then retrieve the successful and failed results. ✓Correct. This is the Bulk API 2.0 ingest lifecycle: create, upload, close with UploadComplete, monitor, and retrieve results.
B. Create the job; split the data into batches of 10,000 records; add each batch; close the job; then query each batch's status.Manually creating batches is the Bulk API 1.0 pattern; Bulk API 2.0 handles batching internally.
C. Upload the CSV to a Static Resource; create the job referencing the resource; then call the job's execute endpoint.Bulk API 2.0 does not load data from Static Resources and has no execute endpoint.
D. Create the job; upload the data; Salesforce starts processing as soon as the first rows arrive; then retrieve results.Processing starts only after the job state is set to UploadComplete, not when the first rows arrive.

Why: A Bulk API 2.0 ingest job is created, receives its data, is marked UploadComplete to start processing, and is monitored until complete. Results are then downloaded as successful, failed and unprocessed records.

10

An analytics team needs to extract 60 million Case records every weekend into a data lake. The current REST API query with nextRecordsUrl takes many hours and consumes a large number of API calls. What should the architect recommend?

  1. Use SOQL OFFSET in the REST query to fetch the records in parallel ranges.
  2. Use a Bulk API 2.0 query job and download the results in pages using the locator and maxRecords parameters.
  3. Use a Batch Apex job to send the Cases to the data lake with one callout per record.
  4. Create a report on Cases and schedule it to email the data lake an export.
Show answer

Answer: B

A. Use SOQL OFFSET in the REST query to fetch the records in parallel ranges.OFFSET is limited to 2,000 rows and is not suitable for large extractions.
B. Use a Bulk API 2.0 query job and download the results in pages using the locator and maxRecords parameters. ✓Correct. Bulk API 2.0 query jobs process large queries asynchronously and return results in CSV pages, using far fewer API calls than REST paging.
C. Use a Batch Apex job to send the Cases to the data lake with one callout per record.One callout per record for 60 million records would be extremely slow and hit callout limits.
D. Create a report on Cases and schedule it to email the data lake an export.Report exports are not designed for tens of millions of records or automated data lake ingestion.

Why: For large data extraction, Bulk API 2.0 query jobs run asynchronously and handle chunking internally. Results are retrieved in pages with the locator value.

11

A sales app used by 4,000 reps polls Salesforce REST API every 30 seconds to check for new lead assignments, making three separate calls each time. The org regularly approaches its daily API request limit. Which two changes reduce API consumption while keeping assignments timely? (Choose 2)

  1. Ask Salesforce to switch the org to unlimited API requests.
  2. Replace polling with an event-driven design where the app subscribes to a platform event published when leads are assigned.
  3. Shorten the polling interval to 10 seconds with smaller queries.
  4. Switch the app to SOAP API because SOAP calls do not count toward the limit.
  5. Combine the three calls into a single Composite request whenever the app does need to call the API.
Show answer

Answer: B, E

A. Ask Salesforce to switch the org to unlimited API requests.API request allocations are based on edition and licenses; there is no unlimited option to request.
B. Replace polling with an event-driven design where the app subscribes to a platform event published when leads are assigned. ✓Correct. Subscribing to events removes the constant polling calls and delivers assignments as they happen.
C. Shorten the polling interval to 10 seconds with smaller queries.Polling more often multiplies the number of calls and makes the limit problem worse.
D. Switch the app to SOAP API because SOAP calls do not count toward the limit.SOAP API calls count toward the same daily API request limit.
E. Combine the three calls into a single Composite request whenever the app does need to call the API. ✓Correct. A Composite request executes several subrequests and counts as one call against the API request limit.

Why: To reduce API usage, replace polling with event-driven notifications and combine related calls with Composite resources, which count as a single API request.

12

A government agency's legacy middleware only supports SOAP and needs to call custom Salesforce logic that validates and creates permit applications. How should the developer expose this logic?

  1. Create an @RestResource class and share its URL with the middleware team.
  2. Create a platform event and have the middleware publish it through SOAP API.
  3. Generate the Enterprise WSDL and have the middleware call the create() operation.
  4. Create a global Apex class with webservice static methods and give the middleware the WSDL generated from the class.
Show answer

Answer: D

A. Create an @RestResource class and share its URL with the middleware team.An Apex REST service does not provide a SOAP interface or WSDL, which the middleware requires.
B. Create a platform event and have the middleware publish it through SOAP API.This avoids custom logic exposure but gives no synchronous response with validation results.
C. Generate the Enterprise WSDL and have the middleware call the create() operation.The standard create() call performs plain DML and does not run the custom validation logic as a single service operation.
D. Create a global Apex class with webservice static methods and give the middleware the WSDL generated from the class. ✓Correct. Methods declared with the webservice keyword in a global class are exposed as a custom SOAP web service with its own WSDL.

Why: Apex SOAP web services are built with global classes and webservice methods. Salesforce generates a WSDL from the class that external SOAP clients use.

13

A healthcare startup is building a native mobile app that lets patients' care coordinators log in with their Salesforce credentials. The app cannot keep a client secret confidential. Which OAuth approach should the architect recommend?

  1. OAuth 2.0 web server flow using PKCE, so the authorization code exchange is protected without a client secret
  2. OAuth 2.0 JWT bearer flow with the private key embedded in the app
  3. OAuth 2.0 client credentials flow with the secret stored in the app bundle
  4. OAuth 2.0 username-password flow with credentials entered in a native form
Show answer

Answer: A

A. OAuth 2.0 web server flow using PKCE, so the authorization code exchange is protected without a client secret ✓Correct. The authorization code flow with PKCE is the recommended pattern for public clients such as mobile and single-page apps.
B. OAuth 2.0 JWT bearer flow with the private key embedded in the appEmbedding a private key in a distributed app exposes it to anyone who inspects the app.
C. OAuth 2.0 client credentials flow with the secret stored in the app bundleClient credentials is for server-to-server use, and a secret in an app bundle is not confidential.
D. OAuth 2.0 username-password flow with credentials entered in a native formThis exposes user passwords to the app and is discouraged; it also bypasses the standard login and MFA experience.

Why: Public clients cannot protect secrets. The authorization code (web server) flow with PKCE prevents interception of the code and is the recommended choice for mobile and browser-based apps.

14

A developer has written an Apex class that calls an external geocoding REST API. The unit test fails with an error stating that callouts are not supported in test methods. What should the developer do?

  1. Annotate the test class with @isTest(SeeAllData=true) to allow live callouts.
  2. Wrap the callout in Test.startTest() and Test.stopTest() so it runs asynchronously.
  3. Add the geocoding endpoint to Remote Site Settings in the test org.
  4. Create a class that implements HttpCalloutMock to return a fake response, and register it with Test.setMock() before calling the code.
Show answer

Answer: D

A. Annotate the test class with @isTest(SeeAllData=true) to allow live callouts.SeeAllData controls data visibility; it does not allow real callouts from tests.
B. Wrap the callout in Test.startTest() and Test.stopTest() so it runs asynchronously.startTest and stopTest reset limits and run async work, but real callouts are still not allowed.
C. Add the geocoding endpoint to Remote Site Settings in the test org.Remote Site Settings do not change the rule that tests cannot make real callouts.
D. Create a class that implements HttpCalloutMock to return a fake response, and register it with Test.setMock() before calling the code. ✓Correct. Tests cannot make real callouts; HttpCalloutMock supplies a simulated HTTP response so the code path can be tested.

Why: Apex tests cannot perform real callouts. Use Test.setMock() with an HttpCalloutMock implementation (or a static resource mock) for HTTP callouts, and WebServiceMock for SOAP callouts.

15

A nightly Batch Apex job synchronizes Account data to an ERP. When an execute call fails with an unhandled exception, the operations team wants a log record created automatically with the failed record Ids and the error, without adding try-catch logic around every statement. What should the developer implement?

  1. Implement Database.Stateful and collect errors in a list that is inserted in the finish method.
  2. Schedule a second batch job that compares Account and ERP data each morning.
  3. Query AsyncApexJob in the finish method and create a log for each failed job.
  4. Implement Database.RaisesPlatformEvents in the batch class and subscribe to BatchApexErrorEvent with a trigger that creates the log records.
Show answer

Answer: D

A. Implement Database.Stateful and collect errors in a list that is inserted in the finish method.Stateful variables do not capture unhandled exceptions, which stop the execute call before the list is updated.
B. Schedule a second batch job that compares Account and ERP data each morning.Reconciliation finds differences later but does not capture the specific errors from the failed transactions.
C. Query AsyncApexJob in the finish method and create a log for each failed job.AsyncApexJob reports the number of failed batches and an extended status, not the record Ids in each failed scope.
D. Implement Database.RaisesPlatformEvents in the batch class and subscribe to BatchApexErrorEvent with a trigger that creates the log records. ✓Correct. Batch classes that implement Database.RaisesPlatformEvents publish a BatchApexErrorEvent when an unhandled exception occurs, including the job scope and exception details.

Why: BatchApexErrorEvent provides a supported way to handle unhandled exceptions in Batch Apex. The event includes the exception message, stack trace and the scope of the failed execute call.

16

A retail company runs its order analytics on AWS and wants Salesforce platform events and change events delivered to Amazon EventBridge without building or hosting a custom subscriber application. What should the architect configure?

  1. An outbound message pointing to an AWS API Gateway endpoint.
  2. A Batch Apex job that queries events every hour and posts them to AWS.
  3. A custom CometD client hosted on an EC2 instance.
  4. An Event Relay that forwards the selected event channel to an Amazon EventBridge partner event source.
Show answer

Answer: D

A. An outbound message pointing to an AWS API Gateway endpoint.Outbound messages are SOAP notifications for record changes, not a delivery path for platform events or change events.
B. A Batch Apex job that queries events every hour and posts them to AWS.Platform events cannot be queried with SOQL, and hourly polling is not event-driven.
C. A custom CometD client hosted on an EC2 instance.This works but requires building and operating a custom subscriber, which the requirement wants to avoid.
D. An Event Relay that forwards the selected event channel to an Amazon EventBridge partner event source. ✓Correct. Event Relay sends platform events and change events from Salesforce to Amazon EventBridge without custom middleware.

Why: Event Relay is a native Salesforce feature that relays platform events and Change Data Capture events to Amazon EventBridge, removing the need to build a subscriber.

17

A subscription business charges customers by sending a POST request from Apex to a payment provider. Sometimes the callout times out after the provider has already charged the card, and the retry charges the customer twice. Which two practices should the architect apply? (Choose 2)

  1. Retry failed payment callouts immediately in a loop until a success response is received.
  2. Generate a unique idempotency key once per payment, store it on the payment record, and send the same key in a header on every retry.
  3. Switch the payment callout from POST to GET so it is naturally idempotent.
  4. Set the callout timeout to the minimum so failures are detected faster.
  5. Schedule retries with exponential backoff, for example through a Queueable with a finalizer, instead of retrying in the same transaction.
Show answer

Answer: B, E

A. Retry failed payment callouts immediately in a loop until a success response is received.Tight retry loops overload the provider and still create duplicate charges without an idempotency mechanism.
B. Generate a unique idempotency key once per payment, store it on the payment record, and send the same key in a header on every retry. ✓Correct. Providers that support idempotency keys return the original result for repeated requests with the same key, preventing double charges.
C. Switch the payment callout from POST to GET so it is naturally idempotent.Changing the HTTP method of a charge request is not supported by the provider and GET should not change state.
D. Set the callout timeout to the minimum so failures are detected faster.A shorter timeout causes more timeouts after successful charges, increasing the risk of duplicates.
E. Schedule retries with exponential backoff, for example through a Queueable with a finalizer, instead of retrying in the same transaction. ✓Correct. Spacing retries with backoff gives the provider time to recover and avoids hammering it during an outage.

Why: Retries are only safe when the operation is idempotent. Use an idempotency key (or external ID upsert) so repeated requests have the same effect, and space retries with exponential backoff.

Find out if you're ready to pass

Take the free Platform Integration Architect diagnostic: 20 questions, no account needed. Then unlock all 299 questions, full practice exams and the study guide.

Start the free diagnosticSee plans

Other sections of this exam