Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Representational state transfer, or REST, is an architectural style for networking software to transfer information through the web.

3
votes
1answer
85 views

How to deal with friend requests in social API REST

I'm designing an API that a social network app will consume. I need to manage friend requests between users. I have this endpoint: POST /users/{userId}/friend-requests { requesterId: string } ...
0
votes
0answers
43 views

Is there a standard for transmitting credentials using two-factor-authentication?

Wie are currently developing a portal solution. In this portal solution we integrate an authentication service which manages authenticated users. Additionally we integrate another application (...
-2
votes
0answers
58 views

RESTful API. Designing response output [on hold]

I have a GET API which I'm designing with minimal business logic around the data being fetched from the database. Is it okay to wrap the multiple DTOs being fetched from the database into a single ...
-1
votes
1answer
102 views

Pros and Cons, use REST api vs querying directly to database with different client platforms [on hold]

We want to figured out, whats are the pros and cons, when you use a REST api vs querying directly to a database, if you have different client platforms (Web-Application, Android, iOS). Edit: I know ...
-1
votes
1answer
55 views

APIs: Many minimal ones or a few bigger

I'm currently working on a project/product which consists of ~60 REST APIs and one client (Web app) I find many downsides on this design, and not so many benefits, and I'd like to know if this is ...
4
votes
2answers
206 views

Is it violation of single responsibilty to add a method to an existing API

Say i have a Rest API that has a POST and GET method. If i want to overwrite a resource in the API i can call the GET method to get the original item and then call the POST method to replace that ...
2
votes
1answer
38 views

recommendations regarding resource uri

lets say we have a "door api" and I want to create a resource to close the door. I could do this in 3 ways: traditional way using PUT with payload {id: XX, color: YY, closed: true} advantages: ...
-1
votes
1answer
39 views

What's the current state with Application-Level Profile Semantics? Anyone use them?

Reading books on REST architecture(especially O'Reilly) many times I came across the idea that one should attach data's description into link http header. Link: <http://example.com/...
0
votes
2answers
53 views

RESTful API authorization for updatable fields

I've got a resource as follows where state is a enum: { id: 123, industry: { id: 245, name: "Farming" }, "scheduleDate": "2018-01-01", "state": "Requested|Approved|Standardized|...
-3
votes
0answers
31 views

Testing a Rest controller with a in-memory database: Integration or System test?

While reading about types of tests, I couldn't answer the following question: If I write a test that performs a call to an REST endpoint without mocking anything on the way and use an in-memory ...
1
vote
1answer
44 views

Should I separate the REST sessions from the sessions in the rest of the application?

Assuming I have resources I restrict access to with a username + password login in my web application and in my REST API. Should I keep different sessions for both meaning that a login via the web UI ...
1
vote
2answers
248 views

Stateful authentication in REST API using tokens

I have recently started on a project involving a REST API. The API requires authentication with requirements for administrators to be able to view logged in users and to be able to revoke specific ...
0
votes
0answers
34 views

Are REST Resources and GraphQL Object Types conceptually equal?

I'm in the process of outlining the intended business logic of a web service. At this point, I'm not too concerned with implementation details. On the contrary, I'm looking for ways to abstract them ...
3
votes
2answers
112 views

Proper URL structure in REST API to change status of one particular record

What's the proper URL structure in REST API for changing state of one particular record (e.g. change from "new" to "processed"). Now I work with this URL without request body: PATCH /employees/123/...
2
votes
1answer
65 views

Web API: REST-ish pattern for flexible querying of time-series data

I'm working on a product that exposes a RESTful API to interact with system entities (the usual CRUD), which works very well. In addition to CRUD, we've recently encountered a need to expose the ...
6
votes
4answers
215 views

Pagination with API

I'm currently building an opensource administration interface to help people easily manage their contens/websites. Application built on Vue.js and heavily rely on json configurations for which fields ...
1
vote
2answers
51 views

API - editing subset of attributes

Given a resource for which only its subsets of attributes can be edited, {E.g. invoice (resource) with a status (attribute) and paidAmount (attribute)}, in terms of API design, which amongst the ...
1
vote
1answer
63 views

Are data attributes good identifiers of certain blocks of HTML code?

I have a complex environment which is mostly oriented around / ends up spitting out blocks of HTML, which make up the entire page. Now, I need a way to "point and click" identify any block on my page ...
0
votes
4answers
155 views

Rest API Design in case of partial success

So I have a ticket booking system. I have ticket booking request on api, from my application we call payment service. If failed on first attempt we proceed by adding message on queue for handling ...
1
vote
0answers
27 views

How to make rest api end points in swagger UI pre authenticated in Spring BOOT

I have written a spring boot rest API application with OAuth.I have integrated swagger UI for API documentation. I want the API endpoints on swagger UI to be accessible without an access token. Please ...
1
vote
1answer
69 views

API Architecture: Should the API update the database on it's own? Or should there be another service to tell it to update the database?

I am working on a project which has a requirement to records in the database every day. I currently have a REST API which does the usual CRUD functions. Should I create a service within the ...
1
vote
2answers
48 views

Returning JPA Entities in Rest Api's?

Recently Ive seen so many devs working with the stack Spring/JPA and returning all these JPA entities on their rest controllers. In my opinion it's a BAD PRACTICE for several reason such: ...
0
votes
2answers
120 views

How to limit the amount of requests by minute to a external system on a micro services environment?

I'm having some problems to think on a solution to control the amount of requests by minute to a external system on a micro services environment on Kubernetes. The scenario This external system is ...
1
vote
0answers
31 views

API Architecture Decision on Authorization & Validation levels

We are designing an authorization mechanism for a Product API where users have their own claims. The api has a patch request like this: PATCH https://product-fcd.com/api/product -d {"Products": []} -...
0
votes
1answer
33 views

Handling data from mobile app to server - realtime or batched csv file or another method?

I'm working with a 3rd party mobile app that has two methods of transmitting data... Realtime via POST request - each POST request is a row of data per second. This will be for maybe 5 minutes at ...
1
vote
0answers
23 views

Does this archicteture work for a Mobile App and Destkop App

This is a proposal of a Distribuited Cloud Architecture for DAWUF which is a Digital Audio Workstation under design and developmente in JAVA, XAMARIN, with REST services The white boxes are the ...
0
votes
0answers
59 views

How to handle incomplete URL's in Rest Web Service

I have written new Rest Web Service, in which I have employeeInquiry method is present. During testing of web service(/employee/{employeeId}/details) using SOAP UI tool, QE is passing employeeId as ...
0
votes
1answer
43 views

API POST Response for Hierarchical objects

If I am sending a POST request to update some object in a DB, such as : User{ id: 20, name: "Jack", UserAssociations:[{ id: 100, association: object1 ...
1
vote
0answers
69 views

Migrating a client from a REST API to a WebSocket one

I'm working on a system that integrates with several third party services via APIs. Those services require authentication. Usually, the services are implemented as REST APIs using HTTP. My system ...
2
votes
1answer
260 views

Implementing a REST API in a Clean Architecture

I have been implementing a proof of concept application using Uncle Bob's Clean Architecture and I have run into a bit of a problem. Uncle Bob's architecture calls for the explicit separation of ...
2
votes
1answer
62 views

API internationalization

I have a question about architecture and I would like to know your opinion. Given a product formed by an API and several consumers (Android apps, iOS apps, web apps ...), where should I implement the ...
1
vote
2answers
97 views

Stateless Service

I am currently working on a player design. Without going into details I have two main layers 1. Playback services 2. User Interface. Playback services consist mainly of Player service and Browser ...
0
votes
0answers
31 views

GraphQL - should i enrich it with hypermedia

I know that GraphQL and REST are different approaches. But what if I need to provide hypermedia links and state transitions to my API design besides agile queries? Should I expose 2 different layers, ...
0
votes
1answer
128 views

Break up django monolith into microservices

We currently have a big Django web application: all data is centrally managed by the webapp, via models backed by Postgres. We want to offer access to the data in a more decentralized way, and the ...
36
votes
5answers
5k views

How to describe an architectural shift that intentionally breaks REST standards?

I'm proposing changes to a very poorly architected software project that suffers from a multitude of problems. At a high level the project utilizes Angular on the front-end and consumes various REST ...
-1
votes
2answers
54 views

What should be the REST API (URL) for a user to be assigned to multiple territories

In our application we have a user who can be assigned multiple territories. What is the best way to expose the REST API? Should it be as : [POST] www.xyz.com/Territory/User OR [POST] www.xyz.com/...
1
vote
3answers
101 views

How use a REST interaface for implementing tasks commands on my Web API?

I'm creating a Web API with a lot of REST Resources. My service also have some tasks which should be started on demand. for instance "Start sending emails". For now I do have a specific URL which I ...
0
votes
2answers
183 views

RESTful API Relationships

Lets say we are making an API with two resources: Author and Book where books can have many authors and authors can have many books. So we design the REST api like so: /books /books/:id /books/:id/...
8
votes
5answers
513 views

Designing function based RESTful API

Please settle an argument between me and a friend. We'r currently designing a product API. Our Product entity looks like this { "Id": "", "ProductName": "", "StockQuantity": 0 } Product ...
2
votes
2answers
89 views

Should a POST endpoint in a REST API allow the inclusion of related resources?

Given the following REST endpoints: (GET, POST) /api/v2/employer (GET) /api/v2/employer/{id} (GET, POST) /api/v2/employer/{id}/employees Should a consumer of this API have the ability to ...
0
votes
0answers
59 views

REST API standards to include method in Controller or service layer

We are using REST API with Spring MVC to develop endpoints. I have a question related to method location (controller layer or service layer). Controller has a get() method which accepts some ...
3
votes
2answers
116 views

REST Resource Validation: Conditionally Required Fields Vs. Separate Resources

Is it better REST API design to use conditionally required fields or to create different resources based on the controlling field's value? Here's an example: POST route/automobile { "type": "car", //...
0
votes
2answers
146 views

Single page apps and backend APIs

When creating single page apps that communicate with a backend API via ajax, what is common (best?) practice regarding updating different server side database objects as a result of one client side ...
1
vote
1answer
70 views

Test RESTful APIs?

When testing RESTful JSON APIs with ATDD/BDD practices in mind is it good practice to test the structure of the response? I'm thinking that it could too easily change, thus making for a brittle test. ...
-1
votes
1answer
300 views

Making all angular services extend a single base service

In Typescript/Angular 6 (2+), is it considered a good practice to have a base abstract http service from which derives all the application services? for example: //import the angular Http ...etc ...
0
votes
0answers
15 views

Best approach when moving applications from DB integration to Web service integration?

I need advice on how to, in an Agile way, move from integration via database to integration via Web-services. We have a bunch of applications that support core business and then some other who are ...
0
votes
0answers
136 views

Use of UUIDs (Primary key) in a REST API

I faced the problem bellow when I designed our new app. We are thinking to have one extra column for some tables which is a UUID for security purposes. So, there are two different solutions. First ...
2
votes
1answer
66 views

Design: Update properties on an entity in a RESTful, resource-based, API

I am working on a RESTful, resource-based, API and I have a large entity (an account) with a lot of properties (30, we'll say). The account has a couple of properties that can be changed... Name: ...
1
vote
2answers
164 views

Implementing interfaces vs using a base class

I am writing an application in python. The part I am little confused about is providing a little structure to my code. This is the basic requirement of my web application. I have these different ...
0
votes
1answer
43 views

Trade-offs between explicit or implicit account id in a REST route

Please consider the following example (common in SaaS applications): This is a SaaS that deals with Widgets. You have an Account, that you authenticate via an API key. Each API key authenticates ...