Stack Exchange Network

Stack Exchange network consists of 175 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

Questions tagged [rest]

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

0
votes
1answer
85 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
42 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 ...
0
votes
0answers
92 views

dealing with too many DTO / Java

We are building an pseudo-rest API (because no body cares/funds for a full blown rest API for internal use - which is OK). So we have elements of Rest API (links for resources, API naming conventions ...
1
vote
3answers
221 views

Determining response codes from void functions OOP

I am trying to create a Put endpoint using rest. Let's say that under the link /addresses/12345 I am trying to add a new address (if that id doesn't exist) or I'm trying to update it if it does ...
0
votes
1answer
65 views

REST-like HTTP POST request with JSON

I am coding a poof-of-concept throw-away GCC plugin (see this for more context) which would use the HTTP 1.1 protocol to interact with my Bismon (GPLv3+ code on github, but unreleased; draft technical ...
-1
votes
2answers
47 views

Implementing http patch using less number of possible cases

Maybe this is stupid question but if I implement http patch, is there no good way to reduce the number of possible cases without exploding into a large number (2^n) of different cases depending on ...
2
votes
2answers
132 views

How to create useful error messages in a JSON REST API without leaking implementation details across layers?

We're implementing a REST service with three main layers: Controller, Domain, Repository. The REST API is supposed to respond to error conditions with meaningful error messages. Suppose the general ...
1
vote
1answer
28 views

track user actions on UI and store them in the database

I have the web application that provides user with the interface to edit its character. When user makes some changes and saves them, I store it as delta in MongoDB. UI and backend communicate via REST....
1
vote
0answers
22 views

OAuth2 - client_credentials

I am in the process of building out a private REST API. This API is intended for machine to machine communication. In short someone else's server will kick off a job via CRON that pulls information ...
2
votes
1answer
100 views

Microservices design: Sharing and populating data

I'm developing a microservices based application and having trouble to understand how api calls should be organized between microservices ... Suppose my application is a products management ...
1
vote
2answers
128 views

How to structure files for API versioning?

My first time trying to implement API versioning here, and I need some guidelines on how to do it... I know there are many ways of doing API versioning. I'm already decided on doing it by uri (i.e, ...
1
vote
3answers
91 views

Affecting the behaviour of a REST API POST

I have an API that has a POST method to create a new Product. The creation of the new Product is handled by POSTing to a ProductService. Now I want to be able to instruct the API when creating the new ...
-2
votes
1answer
68 views

Generate HTTP RESTful server from database schema

Today the job of most Java-based servers is to translate HTTP requests into SQL commands/queries and send a JSON-ed response back to the client. That's a pretty generic (and honestly boring) job. I ...
1
vote
1answer
49 views

How to implement a partial resource rest api?

I first posted this question on stackoverflow but I think, it as more it's place here. In order to limit the size of my REST API answers, I want to implement the Google performance tip: using the ...
-1
votes
0answers
51 views

PUT API conventions in a CQRS Event sources system

I am having trouble deciding between building a single PUT API (if you pass an entity id that exists in the system, it replaces that entity) vs two CREATE(does not allow you to replace an entity with ...
-1
votes
2answers
107 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 ...
0
votes
1answer
75 views

Is it a bad thing to delegate a callout to an external system, given that my current one can't do it?

Custom code written for the Salesforce platform is incapable of making a PATCH request to an external server (PUT and POST are okay though), and I need to make a PATCH request to an external service (...
-1
votes
1answer
98 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 ...
0
votes
0answers
4 views

Should my unittest code be much more than my code for a REST API? [migrated]

I am currently developing a Django Rest Framework API with TDD. I have 15 tests and counting for two views, which doesn't seem right to me. It takes me a lot of time to write the tests and a lot of ...
0
votes
1answer
34 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 ...
2
votes
4answers
119 views

Proper HTTP method for triggering a process [duplicate]

I have a question regarding HTTP methods and what would be most proper in terms of conforming to REST principles. I have two services, A and B. When new data is added, or old data is updated at ...
1
vote
2answers
96 views

Real Time Web Sockets Architecture

I am confused here on how real time analytics is accomplished with web sockets when data is inserted into the system via a REST API. In my (admitted immature) understanding of web sockets, you have ...
2
votes
1answer
81 views

How to design document exchange system

I am trying to come up with a design of document exchange system. System should be for business-to-business communication. Description: There will be possibly 100+ clients(consumers) - they will have ...
2
votes
1answer
82 views

Trying to figure out how to make the syntaxes of 2 different API's the same

I'm doing research to a problem occurred in our company. We have a front-end web portal which communicates by API with a back-end in a same syntax, for example: "www.123.com/api/v1/getCustomers". ...
2
votes
1answer
58 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 ...
7
votes
4answers
356 views

Advantages of HATEOAS based RESTful service

There is a scenario, where we have two commercial applications that are so called REST based(java) but not HATEOAS compliant. Development activity is out-sourced to vendor Development phase of ...
6
votes
3answers
153 views

General question about REST principles

I am unsure, if I understand the principles of REST completely. The idea behind it is (according to e.g. Wiki and other sources) that data is transferred via HTTP(S) and addressed via URIs. Depending ...
8
votes
5answers
481 views

Consequences of not doing a REST API the “right” way?

I'll ask this question this way - what are the software engineering concerns for not implementing my REST API the "right" way? What do you mean the "right" way? Well, allow me to explain my ...
0
votes
2answers
61 views

backwards compatibility of REST API for update/patch when adding new fields

Context: Suppose the current way to update a person is to use HTTP PATCH, where you can set the firstname and lastname: { "firstname": "john", "lastname": "doe" } And you want to add an extra ...
1
vote
2answers
90 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 ...
5
votes
2answers
281 views

Is it bad practice to use a single endpoint to do multiple similar tasks?

So the scenario is that I'm asked to redesign and refactor a REST API by combining multiple endpoints that do similar tasks. For example, now I have 10 different endpoints that are all used to upload ...
0
votes
2answers
98 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 ...
1
vote
1answer
62 views

Check if object exists before updating/deleting

In an application that doesn't use an ORM, is it good practice to check whether an object exists before attempting to update/delete it? For example: @Route(method="DELETE", path="/posts/\d+") ...
0
votes
0answers
28 views

How do I separate REST annotations, JSON serialization and data validation?

I have inherited a REST API and I'm looking at the best way to refactor it so that I can separate out the different architectural parts to aid: making the code base leaner, cleaner and tidier further ...
0
votes
3answers
84 views

REST model sharing between client and server

Consider two facts of a typical organization: Some entities are very common (e.g. Order in a POS system) Some entities might have complex relations (e.g. Order might have a list of Items, a ...
0
votes
0answers
95 views

Where should the API reside?

I have a microservice(opsApiServ) which hosts API to do operations(ops). /ops - POST, GET /ops-item - GET ops-item is just a single unit of operation, and ops is collection of operations (ops-item). ...
-1
votes
1answer
61 views

RPC with Express JS? [closed]

I've been working on a project recently where I have an Expressjs server that supplies weather forecast data to its clients. Right now, I'm using express simply as a means of exposing some functions I ...
0
votes
1answer
80 views

Synchronize multiples REST api, centralized into 1 web application

I am developing a web application for a client, connected to 4 differents sources : E-commerce website CRM Emailing platform Surveys platform All the sources have REST Api's. The web application ...
2
votes
3answers
102 views

Design: Where should methods specific to a model, but not an instance go?

Let's say I have a User model defined. It makes sense that methods for retrieving certain fields of this model lives in the model file. My question is where something that generates a unique UUID, or ...
2
votes
3answers
204 views

Is something like “answers/{id}/downvote” considered RESTful?

Looking at Stack Exchange API docs, I see methods like answers/{id}/downvote answers/{id}/downvote/undo comments/{id}/delete. Should this be considered a RESTful API? (The docs does not mention the ...
-2
votes
2answers
68 views

REST API acceptable design flexibility

I design and works on lot of projects involves REST APIs. But one question is always occur to me if it is acceptable way to do REST. So according to REST manuals online, REST is build upon two major ...
2
votes
1answer
156 views

Long running server process. How to update client

What I'm looking for is a pattern for the client triggering a server process, then the server process signalling the client when its finished. preferably with examples available in .NET or dotnetcore ...
0
votes
1answer
32 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
71 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 ...
1
vote
1answer
74 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 ...
0
votes
0answers
21 views

How to provide an extension point for library that should authenticate asynchronously using WebClient?

I'm trying to design a library (nuget package) that would read data from a REST API and deserialize it to DTO objects. The API requires authentication which is usually done with Microsoft's ADAL ...
-1
votes
2answers
100 views

Use different webservers for REST interface and HTML?

An application provides a REST interface to offer status and statistics information. localhost:1111/stats -> return JSON encoded statistics localhost:1111/status -> return JSON encoded system ...
1
vote
2answers
60 views

DDD aggregates, entities, REST and how they all fit together

I'm trying to apply DDD principles to an application that has a REST API in front and is backed by an SQL storage. Here's the entity structure I have come up with so far: Client: 1 ---- * Contract: ...
1
vote
1answer
51 views

Using frameworks that map database to RESTful APIs?

While researching RESTful API frameworks I've come across (generally speaking) two types of frameworks: The first type will (more or less) directly (or nearly directly) map an ORM/ODM scheme of your ...
0
votes
0answers
64 views

HTTP Method and REST URL for Returning Data that May Be Saved

My application has a grid with a list of Car objects from a third party system [{id: 1, make: "Ford", model: "Focus", ...},...] The user can select a Car and use its data (after some transformation)...