Questions tagged [rest]

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

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

Cache maintained by caller app or by provider app in microservices inter-app communication?

Suppose there are app1 and app2 in a microservices. app2 needs to call app1's RESTful APIs. Cache is needed since the call will be frequent. So after a successful RESTful call, there will be cache ...
0
votes
3answers
59 views

DDD and Infrastructure micro-Services - how should the interface be designed?

We've extracted our email sending into an EmailService - this is a microservice that provides resiliency and abstracts the email logic into an Infrastructure service. The question is how the ...
-2
votes
2answers
73 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 ...
-1
votes
1answer
59 views

How to handle major changes (cross-cutting concerns) in REST API?

Let's say we have a REST API application A consumed by other 30 applications. Application "A" uses a cross-cutting security implementation using a Security NuGet package 1.0. All minor/major changes ...
1
vote
1answer
67 views

How to handle API token(s) that expires after time

I'm currently building a facade that's supposed to be in front of a system we are currently using. This system has its own API, but we have decided to simplfy things, and therefore the facade. ...
18
votes
4answers
17k views

Should HTTP status codes be used to represent business logic errors on a server?

I'm at a bit of a crossroads with some API design for a client (JS in a browser) to talk to a server. We use HTTP 409 Conflict to represent the failing of an action because of a safety lock in effect. ...
0
votes
0answers
31 views

In a DDD CQRS API, is it preferable to have a separate DTO per query or per representation of a resource?

I am in the middle of starting up a new project and just wanted some reassurance as to which approach to DTO's returned by the read-side was easier to maintain in a real world application with ...
1
vote
1answer
44 views

How do I create an HTTP PUT request that modifies the resource in many ways

I have a NodeJs backend that interacts with MySQL database. Let us assume that I have a schema similar to this: Book id name Author id book_id name So, I have two tables named Book and ...
0
votes
0answers
18 views

SQLAlchemy with Plain Old Python Objects (POPO)

In SQLAlchemy class models are of data type Column which contain metadata about the table in the database. Such as: id = Column(Integer, primary_key=True, autoincrement=True, nullable=False) When I ...
1
vote
1answer
35 views

Ideal architecture for ML training -> API service workflow, with multiple models/services? [on hold]

I'm planning to construct a workflow/environment for training and serving NLP classifiers, that follows something like: The model training system takes in annotated documents from a subset of a ...
6
votes
2answers
301 views

“REST Vs GraphQL” is it a correct comparison?

I saw in many sites that compare REST with GraphQL. after investigating this concern (actually my concern) that, "is it a correct comparison?", I being more confused. Since the REST has a different ...
1
vote
2answers
543 views

Is serverless architecture a good fit for Django Rest Framework app?

I am building a web/mobile application with Django Rest Framework (DRF) that enables authenticated users to post snippets and/or vote for other user's snippets. All users (authenticated or not) can ...
1
vote
2answers
76 views

Building a rest api layer on top of a soap webservice

We want to build a rest api layer on top of a soap webservice. Our current situation is that we have a coldfusion application that talks with the webservice, both running on different servers. The ...
0
votes
2answers
151 views

Rest API POST with illegal data in parameters: Bad Request or 404?

Take a hypothetical camera company providing an API to manage its users and cameras. Each user owns cameras, and every user of a camera has a role assigned (one of admin, operator, viewer - these are ...
-1
votes
0answers
13 views

How to design a generic RestClient using jersey 2.0.0 version and above? [closed]

I want to make a RestClient class using jersey API version 2.0.0 and above, that provides methods for all kinds of HTTP methods like GET/POST/PUT/DELETE and can support all functionalities like uri-...
0
votes
1answer
108 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
2answers
186 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 ...
-1
votes
1answer
73 views

Is there a reason to have multiple projects for a single API? [closed]

I entered yesterday to my new job and while browsing their repositories, I noticed they have a project for every resource of a REST API. For example, if they need to add a REST resource called "people"...
0
votes
1answer
39 views

How to handle many-to-many relationships with multiple incompatible relationship types in RESTful API?

Note this question is about when there are multiple relationship types. This is not the same as this question, where there is only a single member relationship. Say we have persons and organizations. ...
2
votes
2answers
911 views

Rest api with a hello resource / main entry point

I'm designing a Rest API for our web application. There's one idea that came to my mind today and I haven't found in recent searches: a "hello" resource, where clients are supposed to connect as the ...
-1
votes
1answer
16 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
2answers
111 views

Status code for middleware? 200 or 4XX , 5XX?

I have a design dilemma in deciding the response status code and architecture for a middleware we are designing. So the Client Calls MiddleWare, And middleware calls the 3rd party service to get car-...
10
votes
3answers
7k views

How to consume external RESTful API with Symfony?

We are building a Microservice architecture for our projects, with mostly front-end Symfony applications interacting with back-end RESTful APIs. The problem is this approach is breaking the Symfony ...
-1
votes
1answer
57 views

Resful name API for multiple key objects

We are implementing an API and we want to follow best practices for naming the endpoints. However, during the design, we have found a challenge. We have some objects where the key to the objects is a ...
0
votes
1answer
44 views

rest service with digitally signed parameters

I'd like to build a rest service that will accept objects that has digital signature. This service has to support both xml and json data serialization formats. I'd like to use .Net core framework to ...
1
vote
2answers
60 views

Acceptable to use synchronous call to another microservice for time-sensitve state change?

Say there are two microservices (example is simplified) PickupRequestService: lists pick-up requests of passengers DriverService: drivers use to accept pickup requests On a completely decoupled ...
0
votes
2answers
73 views

Incorporate a background job enqueue endpoint in a REST API

To exchange data between our standalone frontend application and the backend API, we currently have a REST API, with standard endpoint to list/create/update/destroy ressources with a consistent naming ...
11
votes
3answers
8k views

Flat or nested JSON for hierarchal data?

I've switched back and forth ~5 times already. This REST endpoint at /api/tags/ will be for internal use (no 3rd party clients), I'm the only one working with it. I'm deciding between these two ...
0
votes
2answers
78 views

Are REST Methods Which Return Dynamically Generated Random Data Safe

Is a REST method which returns dynamically generated random data each time that it is accessed considered safe? According to RFC 2616 (emphasis mine): ... In particular, the convention has ...
0
votes
0answers
16 views

How to setup REST API in Codeigniter 3.0

I am creating the REST API using codeigniter. I downloaded this library and installed in my application. It works great! https://github.com/chriskacerguis/codeigniter-restserver But I have an doubt. ...
-2
votes
2answers
129 views

Typescript, CRUD Applications, and the generation of resource identifiers

I am currently trying a create a fairly simple, declarative RESTful CRUD framework, whereby I can define a resource type, and have both the API endpoint created, as well as the the functions to Create/...
1
vote
2answers
76 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 ...
45
votes
3answers
12k views

Why PATCH method is not idempotent?

I was wondering about this. Suppose I have a user resource with id and name fields. If I want to update a field I could just do a PATCH request to the resource like this PATCH /users/42 {"name": "...
0
votes
3answers
88 views

API with different kind of response for error

Let's focus on a single endpoint, which always returns an encoded JSON object with a well defined and documented structure. But when an exception is thrown, the exception itself is formatted to a ...
0
votes
3answers
106 views

Url pattern for making a 'like' with a REST API

I have an API route as so: GET /api/item/like Which makes a like object between the logged in user and item object, and it works fine. Is this the correct way to have a user 'like' an object? Or ...
1
vote
3answers
123 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 ...
5
votes
2answers
10k views

RESTful API with session tokens.. ehh?

After looking at a lot of session/state debates with regard to REST and finding nothing concrete, I'm just going to cut to the chase and ask myself. Developing a RESTful API as a backend for a mobile ...
0
votes
2answers
160 views

What HTTP action and return value should be used on resource's action

I have a question about how I should implement a new action for a resource on my API layer. I have a Timesheet which is used by people to let us know how many hours they worked on a job. This ...
37
votes
3answers
34k views

What is a proper way to do a complex RESTful search method?

Following REST principles, I would want to create a GET method for my API that make a search using some criteria and return the results to the client. The problem is that the criteria can have up to ...
0
votes
2answers
62 views

How to handle a request to delete and post?

I am making an application in which there are 3 tables. A user can click a button to request to move an item from table 1 to table 2. Essentially, this means that an item is deleted from table 1 and ...
4
votes
4answers
1k views

Mapping API models(DTOs) to rich domain models

How to implement HTTP's PUT that works with child collections when using DDD's rich domain models? Let's say we've got an aggregate root with a nicely encapsulated collection of items: (I omitted ...
0
votes
1answer
113 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 ...
0
votes
1answer
117 views

REST Many To Many Design

Consider a web api exposing two kind of resources: Users and Teams with many-to-many relationship, typically a REST api will expose the following trivial endpoints to read data: GET /users GET /users/...
0
votes
1answer
45 views

Storing session state in browser's local storage

Stack Exchange has some bits of what seems to be session state -- for example, whether you want to see 15, 30, or 50 questions per page when you view a list of questions. You can click on the button ...
1
vote
1answer
194 views

Listing all sub-resources without parent scope

Let's say I have User resource which has Address sub-resource (let's forget about why this is a resource instead of attribute). To get a user's address, I can do GET /users/{id}/address Now I want to ...
1
vote
2answers
185 views

Pipeline design pattern with context for chaining REST API calls

Just like the title says, I want to use the pipeline design pattern for chaining related API calls. The context will store the data that will be used to create a payload. For example, I have the ...
0
votes
2answers
83 views

How do job queues return results to UI?

I am working on an app that will run queries and return results to UI. However, these queries can take a long time to finish so I should not wait for the result. As far as I know, people use task ...
21
votes
4answers
17k views

Large file / data transfer in a Microservice Architecture

My company is currently working on adopting a microservice architecture but we are encountering some growing pains (shock!) along the way. One of the key contention points we are facing is how to ...
1
vote
3answers
1k views

Alternatives on how to deal with data fetched from external API

We are planning to build a web application which will consume data from an internal REST API that centralizes all of our "core" business data. For matter of demonstration, let's say this API exposes ...
0
votes
2answers
106 views

Some Suggestion about Data Modeling

I want to make a social game for Android. I am using NoSQL Based Database (MongoDB) and I am using NodeJs. I am using Android-Volley library to make POST and GET requests. But I am stucked on ...