General SFDC API questions Flashcards

1
Q

How many types of API’s avaliable in salesforce?

A
  1. Analytics REST API
  2. Apex REST API
  3. Apex SOAP API
  4. Bulk API
  5. Chatter REST API
  6. Metadata API
  7. REST API
  8. SOAP API
  9. Streaming API
  10. Tooling API
  11. User Interface API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When to Use REST API

A

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. For certain projects, you may want to use REST API with other Salesforce REST APIs. To build UI for creating, reading, updating, and deleting records, including building UI for list views, actions, and dependent picklists, use User Interface API. To build UI for Chatter, communities, or recommendations, use Chatter REST API. If you have many records to process, consider using Bulk API, which is based on REST principles and optimized for large sets of data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When to Use SOAP API

A

SOAP API provides a powerful, convenient, and simple SOAP-based web services interface for interacting with Salesforce. You can use SOAP API to create, retrieve, update, or delete records. You can also use SOAP API to perform searches and much more. Use SOAP API in any language that supports web services.

For example, you can use SOAP API to integrate Salesforce with your org’s ERP and finance systems. You can also deliver real-time sales and support information to company portals and populate critical business

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When to Use Chatter REST API

A

Use Chatter REST API to display Chatter feeds, users, groups, and followers, especially in mobile applications. Chatter REST API also provides programmatic access to files, recommendations, topics, notifications, Data.com purchasing, and more. Chatter REST API is similar to APIs offered by other companies with feeds, such as Facebook and Twitter, but it also exposes Salesforce features beyond Chatter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When to Use Streaming API

A

Use Streaming API to receive near-real-time streams of data that are based on changes in Salesforce records or custom payloads. For Salesforce record changes, Salesforce publishes notifications when the changes occur. For custom notifications, you can publish event messages. Subscribers can receive notifications using CometD—an implementation of the Bayeux protocol that simulates push technology. Clients can subscribe to some types of events with Apex triggers or declaratively with Process Builder and flows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When to Use Apex REST API

A

Use Apex REST API when you want to expose your Apex classes and methods so that external applications can access your code through REST architecture. Apex REST API supports both OAuth 2.0 and Session ID for authorization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When to Use Apex SOAP API

A

Use Apex SOAP API when you want to expose Apex methods as SOAP web service APIs so that external applications can access your code through SOAP.

Apex SOAP API supports both OAuth 2.0 and Session ID for authorization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When to Use Tooling API

A

Use Tooling API to integrate Salesforce metadata with other systems. Metadata types are exposed as sObjects, so you can access one component of a complex type. This field-level access speeds up operations on complex metadata types. You can also build custom development tools for Force.com applications. For example, use Tooling API to manage and deploy working copies of Apex classes and triggers and Visualforce pages and components. You can also set checkpoints or heap dump markers, execute anonymous Apex, and access logging and code coverage information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Call In and Call Out?

A

Call In is used to exposing our webservices to another system.
Call out enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is WSDL ?

A

WSDL (Web Services Description Language) is an XML document that describes a web service. WSDL is derived from Microsoft’s Simple Object Access Protocol (SOAP) and IBM’s Network Accessible Service Specification Language (NASSL). WSDL replaces both NASSL and SOAP as the means of expressing business services in the UDDI registry. It is used in combination with SOAP and XML Schema to provide web services over the Internet. A client program connecting to a web service can read the WSDL to determine what functions are available on the server. Any special datatypes used are embedded in the WSDL file in the form of XML Schema. The client can then use SOAP to actually call one of the functions listed in the WSDL. There are two types of WSDL in Salesforce:

Enterprise WSDL
Partner WSDL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is difference between Enterprise WSDL and Partner WSDL?

A
  1. Enterprise WSDL
    a. Is strongly typed.
    b. Is tied (bound) to a specific configuration of Salesforce (ie. a
    specific organization’s Salesforce configuration).
    c. It changes if modifications (e.g custom fields or custom
    objects) are made to an organization’s Salesforce configuration.
  2. Partner WSDL
    a. Is loosely typed.
    b. Can be used to reflect against/interrogate any configuration of
    Salesforce (ie. any organization’s Salesforce configuration).Is
    static, and hence does not change if modifications are made to
    an organization’s Salesforce configuration.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How SOAP can be accessed ?

A
  1. SOAP can communicate with the use of the WSDL file, without the WSDL file the integration won’t function.
  2. The message format in SOAP is XML
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to generate WSDL file?

A
  1. Go to Setup -> Develop -> apex classes
  2. Click on Apex class
  3. Click on Generate WSDL button
  4. Generate WSDL code from class
  5. Save as .wsdl file in your system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to consume external WSDL file

A
  1. In the application, from Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
  2. Click Generate from WSDL.
  3. Click Browse to navigate to a WSDL document on your local hard drive or network, or type in the full path. This WSDL document is the basis for the Apex class you are creating.
  4. Click Parse WSDL to verify the WSDL document contents. The application generates a default class name for each namespace in the WSDL document and reports any errors. Parsing fails if the WSDL contains schema types or constructs that aren’t supported by Apex classes, or if the resulting classes exceed the 1 million character limit on Apex classes. For example, the Salesforce SOAP API WSDL cannot be parsed.
  5. Modify the class names as desired. While you can save more than one WSDL namespace into a single class by using the same class name for each namespace, Apex classes can be no more than 1 million characters total.
  6. Click Generate Apex. The final page of the wizard shows which classes were successfully generated, along with any errors from other classes. The page also provides a link to view successfully generated code.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is remote site settings ?

A

Remote site settings is used to authorize the endpoint and allow us to whom integrate(end user)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How manys ways to XML parsing ?

A

They are two ways of XML parsing

  1. XML streams
  2. XML DOM
17
Q

How to read root element in XML DOM ?

A

getroot element

18
Q

How to read child element in XML DOM ?

A

getchild element

19
Q

How to read all child elements in XML DOM ?

A

getchild elements

20
Q

How to read text between tags ?

A

gettext

21
Q

How SOAP and REST will Communicate ?

A

SOAP will communicate through WSDL file.

REST will communicate through HTTP protocol.

22
Q

What are methods in REST

A

HTTPGET : Retrieve data identified by a URL.
HTTPPOST : Create a resource or post data to the server.
HTTPDELETE : Delete a resource identified by a URL.
HTTPPUT : Create or replace the resource sent in the request body.

23
Q

What is difference between SOAP and REST?

A

SOAP API: The Simple Object Access Protocol (SOAP) is an attempt to define a standard for creating web service APIs. It is a pattern, a web service architecture, which specifies the basic rules to be considered while designing web service platforms. It typically uses HTTP as a layer 7 protocol, although this is not mandatory.

The SOAP message itself consists of an envelope, inside of which are the SOAP headers and body, the actual information we want to send. It is based on the standard XML format, designed especially to transport and store structured data. SOAP may also refer to the format of the XML that the envelope uses. SOAP is a mature standard and is heavily used in many systems, but it does not use many of the functionality build in HTTP. While some consider it slow, it provides a heavy set of functionality which is a necessity in many cases. It might now be the best solution for browser-based clients, due to its custom format.

Supports data in the form of XML only and not JSON.
Requires WSDL for the integration
Use SOAP API in any language that supports Web services.

REST API: The Representational State Transfer (REST) is another architectural pattern (resource-oriented), an alternative to SOAP. Unlike SOAP, RESTful applications use the HTTP build-in headers (with a variety of media-types) to carry meta information and use the GET, POST, PUT and DELETE verbs to perform CRUD operations. REST is resource-oriented and uses clean URLs (or RESTful URLs).

Supports both XML and JSON format
Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster

24
Q

What is JSON ?

A

JSON stands for JavaScript Object Notation. JSON is lighter weight than XML. When exchanging data between a browser and a server, the data can only be text. JSON is text, and we can convert any JavaScript object into JSON, and send JSON to the server.

25
Q

WSDL

A

(Web Services Description Language)

26
Q

What is a heap dump?

A

A heap dump is a snapshot of all the objects in the Java Virtual Machine (JVM) heap at a certain point in time. The JVM software allocates memory for objects from the heap for all class instances and arrays.

27
Q

(NASSL)

A

IBM’s Network Accessible Service Specification Language

28
Q

What is UDDI registry?

A

Universal Description, Discovery and Integration (UDDI, pronounced /ˈjʊdiː/) is a platform-independent, Extensible Markup Language protocol that includes a (XML-based) registry by which businesses worldwide can list themselves on the Internet, and a mechanism to register and locate web service applications.

29
Q

What are the two types of WSDL’s in Salesforce?

A

Enterprise WSDL

Partner WSDL

30
Q

What functions are available in the SOAP API?

A

You can use SOAP API to CRUD- create, retrieve, update, or delete records.

31
Q

What does strongly typed mean give an example?

A

A strongly-typed programming language is one in which each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types.