Questions tagged [web-api]

Specific APIs that communicate over web protocols, such as ASP.net Web API, as well as APIs that are exposed to web pages for network communication or apps for device communication

Filter by
Sorted by
Tagged with
0
votes
1answer
52 views

How to manage breaking updates in an API & database

So I have been working on my mobile app for a while and it is live and in production. Because we released the app prematurely and are continuously improving current features and making them more ...
0
votes
1answer
38 views

Architecture for business functions impacting several Dataobjects/database tables

I am trying to create an example project Web API to see how "clean" I can remake the Delphi(Pascal) API we are developing on my job. I have created a solution which as of now contains 3 different ...
1
vote
2answers
72 views

REST: How to reference existing resources in a HTTP POST request body?

This question relates to a somewhat more specific case than the one discussed in How can I create a RESTful calculator? It should be assumed that the values to be calculated are not simple integers, ...
1
vote
3answers
115 views

Interfaces vs concrete types in DTOs and response classes

Had a discussion that i felt i needed some external input on. Normally always use interfaces instead of concrete types (on lists, injectable services and so forth). For example in lists i just pass ...
0
votes
1answer
52 views

Should two different set of login APIs follwing REST have write access to the same DB?

Like for example, /api_1/login and /api_2/login writing in the same table of the same database.
-1
votes
0answers
23 views

Send and receive verifiable hashes in API [duplicate]

I have an API which uses access tokens (hashes) to verify user identity: user logins in, receives a token and uses it to access other endpoints of the API. Currently every time the users make a call ...
1
vote
2answers
125 views

Should an ASP.NET Web API application use Entity Framework in the API controllers?

Im a bit confused about what is best practice when working with Entity Framework and ASP.NET Web API. I am working on a project that contains a iOS/Android app and an API the app will use to ...
2
votes
2answers
134 views

HTTP 404 for REST calls from client side (browsers)

I'm having troubles with the issue of distinguishing between "real" 404s and 404s where the path is correct but the id, for example, doesn't exist when it comes to client side apps. Most REST ...
1
vote
0answers
35 views

Web Service returning serialized helper objects

I had the idea to have a route in my REST API that returns serialized (PHP) helper objects. The client code then can use those objects to format some complex JSON structures for the next request. When ...
0
votes
0answers
37 views

How do I assign methods if I have 100 endpoints in a RAML spec?

I'm trying to build a RAML API specification for the first time. The API will need to give users access to 100 resources (endpoints), so I'm not sure how to assign methods to them. I assume there has ...
1
vote
2answers
89 views

Authentication setup advice for web app and its backend API

I am fairly new to web development, and I am learning to build web applications. I am facing a problem figuring out how to set up authentication mechanisms for a multi-user application. Let me provide ...
0
votes
2answers
241 views

Who or what exactly does the “Same Origin Policy” aim to protect

As I understand the "Same Origin Policy" is a browser security feature that aims to protect the user. It prevents scripts to load data from another webserver (typicall with ajax). So esentially there ...
0
votes
2answers
54 views

Need suggestions for creating field level permissions which can be changed dynamically in an app

This is currently my User-Role-Permission model in the Db schema (excluded other tables to avoid confusion). My implementation goes like this: I have a Customer table and each Role has a different set ...
-2
votes
2answers
136 views

Confused about how APIs are called

I'm new to APIs. Conceptually, I understand what an API is, but I get confused when it comes to the some of the technical details. All of the tutorials I've read talk about URLs and endpoints, and ...
0
votes
1answer
27 views

How to handle adding new field / partial data update for a gRPC API?

Assuming we have following message that will be used to update data and it just got updated to version 2. message HelloRequest { string name = 1; // version 1 bool is_valid = 2; // version 2 } ...
-1
votes
1answer
20 views

Adding resources to subresource REST API

I'm trying to build an web API that closely represents a library of books. I currently have the following routes. GET /api/books GET /api/books/:bookID GET /api/libraries POST /api/libraries This ...
1
vote
0answers
34 views

Building a schedule app - best design pattern for collection on Rails API

I’m building a web app using Rails API on server side. The goal is to make a planning manager. I want my users to be able to plan ‘daily’ events, which will display at some specific weekdays, with ...
2
votes
3answers
199 views

Dealing with API errors

I'm building a shop system which works in three parts: a mobile app (Android/iOS) which is used by customers to make orders, view products and so on, a desktop application, used by the managers to ...
0
votes
2answers
105 views

Is creating a leaderboard web API that can't be fudged possible?

Let's say you have a game, and players of your game can get scores. You also want to be able to post these scores to a server using calls to a web API. Obviously, you want to be able to tell who sent ...
1
vote
2answers
79 views

RESTful API - Adding nested resources as a query parameter?

I recently had thoughts on handling the flat vs nested architecture when designing a RESTful API. Would there be anything wrong with having a system where your nested resources can be specified ...
0
votes
1answer
112 views

Command Waiting On Event Sourcing Micro-services

I'm very new to micro-services but am trying to learn, so apologies for any ignorance or incorrect information. I have been looking at event-sourcing architecture for microservices and I have a ...
1
vote
1answer
68 views

Architecture for independent modules writing in the same database

Let's say I have a database with a table called "invoices". Then I have a web application where users can manually create invoices against said table. I also have a desktop application that can ...
0
votes
1answer
115 views

RESTful API Endpoints - Concrete vs OO versioning

I am looking at Versioning Micro Services solutions and got a little carried away with OO design. Using WebAPI, I got to the point where I can use OO design to choose the correct version to run with ...
1
vote
3answers
126 views

REST API - Standard for also creating required parent entities?

We're creating a new API to add new Jobs into a legacy system. The question deals with how to handle creating a Job's required parent entities when you don't know the IDs of those parent entities to ...
0
votes
2answers
96 views

How to handle dependencies in Web APIs

I'm struggling with a decision about how to design a web-API where I create new "things". We roughly follow the API guidelines of Zalando, which do provide a nice starting point for web-APIs (https://...
1
vote
1answer
65 views

Should all my asp.net MVC controllers use Web APIs?

The thing that I don't understand is the prioritization between MVC Controllers and Web APIs. Consider I want to make a website. I can either program to APIs and for the presentational layer, force ...
-3
votes
1answer
43 views

Design Restful API Get manipulated data from resource [closed]

I am new to rest, I have an entity called availableJobPositions. I want to get most Interesting job by sending a person skills. which url is good in restful: api/positions/skill/most-intersting?...
0
votes
2answers
103 views

Should I put the messages for business logic validations in API?

I have a REST API written using ASP.NET Core Web API. There are a few business logic based messages I want to send to the clients from the API. I am in a dilemma on which of the following ways I can ...
0
votes
3answers
234 views

Web API Bad Request design

My organization is developing a Web API server. We will also develop the only clients authorized to access the API. We will follow the usual technique of returning Bad Request (400) errors for data ...
0
votes
1answer
297 views

What is the best practice for sending a large array of strings to an API

I'm building a simple app that is a client web application and an API behind it. I'm combining two third-party APIs, one needs to be called from my client application (for ease of authentication) and ...
-1
votes
2answers
52 views

How to handle list arguments with invalid and valid elements

When you have an endpoint that can take a set of valid parameters, how do you do validation on a non-empty set of elements? Say you have a request /api/endpoint?my_list=1,2,3 where 1, 2, 3 are the ...
1
vote
2answers
256 views

How to consume nested objects in API resource

I am building my first web application, it links to the serverside through RESTfull Web API (Angular on client side, ASP.Net Core and EF Core on serverside, Automapper to map API Resources to/from ...
0
votes
1answer
52 views

Designing anonymous registration website

I am developing a website where customers can register products they bought in order to receive a benefit in the form of e.g. a cashback, a discount or promotional goods. In the future, we also plan ...
0
votes
2answers
135 views

How to describe an API-like request that is browser-to-browser?

I'm building a web application that has a feature which allows visitors to directly access resources using URL patterns, for example: www.site.com/client/[clientID]/orders www.site.com/client/[...
-1
votes
2answers
121 views

Why should I use REST API?

I somehow get the point of REST API, like for example you want to get the list of customers to the database server, you have to request a GET method and the server will throw a response with a ...
2
votes
1answer
265 views

Best Practice: Third party API on client (Desktop) or Server

I have a small Desktop application (Windows+Mac) that uses third-party API calls (RESTful) to collect some data and present results to users. At this moment, the API calls (open and free APIs) are ...
-1
votes
1answer
240 views

how to expose complex actions in RESTApi using http verbs

consider the following REST resource Account { number:"number-000", name: "name", customer : {}, type : {}, status : "status", balance : 0, rating : 0.0 } Now say we have the ...
1
vote
1answer
31 views

Logging web API POST requests for retry to outside service

My web API talks to an outside service running elsewhere, based on the web API requests (mostly POST). There is a message queue (RabbitMQ) that sits in between them, for request/response from either ...
0
votes
1answer
63 views

Best way to make insert data in logs web API. REST or WebSockets

I want to make a centralized log web API, so it will have a large amount of data per seconds. the logs will comming from others WEB API I was thinking if i make the REST API, all of the POST made ...
1
vote
1answer
76 views

Data is in database or get from API, where should API request code goes?

For me, the data I want to retrieve may be in database for which I can use properties of model and also relationships, but if the record is not a property and no relationship exists for that ...
1
vote
1answer
65 views

Recommended manner of installation for an open source web application and api?

I'm currently working on my own open source project. There are two parts to it at the moment, a .NET core web API and an Angular client side app. I would like to get your views on installation/setup ...
2
votes
1answer
65 views

Keep Hitting 3rd party API or Store Commonly Queried Data In DB?

Colleague and I have begun a long (and hopefully fruitful) project. I've been building and have come to my first crux, and now I ask the experts of the Stack Exchange for their guidance. I'll keep ...
0
votes
1answer
115 views

Use same API for both website and other clients or not?

Lets say I am building some large application ( multi-page app ) using Laravel. And laravel will allow me to make an API and a website on the same application. Since the website and the API ...
-2
votes
1answer
87 views

Is it a good idea to ask for requestId in each API call?

I see some services which takes a requestId from client as the mandatory attribute while some services doesn't. I feel it is a good idea to have a request Id from the clients because it helps in ...
0
votes
1answer
78 views

Retrieving JSON and image representation of a resource

I am developing a RESTful API designed primarily (but not exclusively) for consumption by a web application. For the purposes of this question, the API is a set of GET endpoints. The main endpoint is /...
0
votes
0answers
191 views

Separating models in a Backend-For-Frontend (BFF) API

At the moment I have a frontend client calling several backend REST APIs. For example a call may be to get information about a certain vehicle. Then the client will call REST API A to get some ...
0
votes
1answer
279 views

The Frontend-Backend Vs. Backend-Backend

I've seen this pattern pop up in a couple of different teams. They have a server with a REST API and a frontend web project. What commonly happens is the frontend developer finds their requests are ...
0
votes
2answers
384 views

Check if user is logged in when using JWT

I have an app that uses JWT tokens for user authorization. Now, I need to be capable of deactivating users (users won't be allowed to use the system but still exist in the database), but as a ...
1
vote
2answers
335 views

Web API POST: single item vs collection

No code to show (and not really a code issue) but I have an iot-ish application running that is using PI Zeroes as clients and they are slow. A single POST takes about 10 seconds round trip, the delay ...
-2
votes
1answer
232 views

How to implement HTTP PUT correctly

I'm really looking for one good example how to PUT operations should be implemented correctly. What I understood until now: The operation must be idempotent When the resource doesn't exists it will ...