About this question
Can somebody explain what is a REST API wrapper? How should it look like? When would we actually need it? Can we call them dtos? Please give some use cases, examples, or links.What is API wrapper?
Can somebody explain what is a REST API wrapper? How should it look like? When would we actually need it? Can we call them dtos? Please give some use cases, examples, or links.What is API wrapper?
Log in to share your answer and help other learners.
Log in to answerBest Answer · By JanBask Data Science Expert
Answered on Jul 29, 2021
A Wrapper Class (or the Wrapper Pattern) is where you declare a class as a container for an sObject to extend the functionality only for display or processing purposes (i.e. you don't intend for that attribute to be persisted) - the classic example is a checkbox to select records. I would say that a DTO is a slightly dumbed down version of such a wrapper (used in conventional OOP to pass structured data between the layers)
A REST Api wrapper is something slightly different. Salesforce exposes a REST API and if you were to invoke that say from C#, you would have to perform a set of common steps such as login, query, etc. To make this available in C# by abstracting the innards of the actual REST calls to salesforce and exposing only the developer relevant detail, you could write a rest wrapper that performs these commonly used functions - creates requests, parses responses, etc
Efrenlarson Latest answer
Answered on Nov 20, 2024
An e-commerce application wants to call the API of a third-party service Undertale Yellow to get product information. Instead of calling the API directly in each method, you can create a class that wraps the API, making your source code easier to maintain and change.
Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.
Step-by-step Data Science guides from industry experts
Common Data Science interview questions, answered
Guides, tips and career advice on Data Science from JanBask experts.
Data Science The Best Data Science Projects (Beginner To Advanced)
Discover 15 data science project ideas from beginner to advanced levels. Includes tech stacks, time estimates, & real-use cases.…
Data Science Data Science vs Software Engineering - What you should know?
Compare Data Science vs. Software Engineering - explore skills, tools, roles, salaries, and career scope. Discover which tech…
Data Science Top 15 Deep Learning Algorithms You Must Know in 2025
Discover the top 15 deep learning algorithms powering AI in 2025. Learn how deep learning models, DL models, and deep machine…
Data Science Deep Learning Tutorial Guide for Beginners
Deep Learning, Machine Learning & Artificial Intelligence have become trending words of the IT sector today.