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.

10
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 ...
-1
votes
0answers
16 views

Authentication Mechanism for Third Part Apps

I have an WebAPI application which is consumed in our native apps. The implemented auth grant type is 'password'. It is working fine. Currently we are creating a native library instead of native apps ...
0
votes
2answers
65 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
6 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. ...
0
votes
0answers
19 views

How to display linked third party sign in methods

I am writing an app. Like Google suggests, the user should be to be able to link multiple sign in methods to their account. In order to do that, the ideas of "identities" and "accounts" are separated ...
-2
votes
2answers
96 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/...
-2
votes
0answers
18 views

Persistent document caching framework caching not (only) in memory? [closed]

We plan to create a document cache service which stores the result of expensive document transformations in a persistent store and which works like Redis but not in memory since we expect several ...
0
votes
1answer
50 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 ...
1
vote
2answers
55 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 ...
1
vote
2answers
71 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 ...
44
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
82 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
101 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 ...
0
votes
1answer
72 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
3answers
121 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
159 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 ...
35
votes
3answers
33k 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
61 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
30 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. ...
0
votes
1answer
109 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
115 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
44 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
174 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
156 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
78 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
16k 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 ...
1
vote
1answer
34 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....
3
votes
1answer
226 views

Designing a flexible search API response

Quick Summary I'm building a search micro-service that will allow searching across different types of resources in a particular system (e.g. blog posts, users etc.). The API that will be exposed will ...
-1
votes
1answer
66 views

Pattern for for REST API who's response depends on behavior of requests to other services

Some one help me with my design paralysis! Assume a microservice (probably going to be implemented in Spring Boot) that has implemented an run of the mill REST API, and after receiving an initial ...
1
vote
1answer
34 views

Client-side XHR request, which IP does the endpoint read?

Assume a Javascript plugin, for a developer, that's included on their website. <script src="https://external.com/plugin.js"></script> The plugin makes a XHR request to a 3rd party ...
6
votes
5answers
340 views

How to adhere to pure REST principles when different functionality is required in different situations

We have a RESTful API that allows for creation of users by POSTing to a particular endpoint, api/v1/users In the system, when a user is created, an email is sent to the user with content along the ...
6
votes
1answer
4k views

Mixing REST and websocket in the same API

A bit of background first, I'm working on an application that manages a piece of physical equipment with motors, stuff like that. When I started on the project, there was an existing application, ...
18
votes
4answers
15k 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. ...
-3
votes
1answer
41 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
95 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 ...
1
vote
1answer
547 views

How to architect a very big web application using server and / or client rendering?

I recently finished a project which contains more than 30 different pages/features. Each one with some CRUD and more subpages. Each page is totally different from another in purpose. All of it was ...
1
vote
2answers
73 views

Are different endpoints to display the same resource in different ways RESTful?

Say I have a Student who has a ID number, a name, a profile picture, some contact details, and is enrolled in several courses. From the perspective of a Single Page Application there are different ...
3
votes
1answer
170 views

REST API Authentication: Cookie vs Web Storage

Note: This question might sound like a duplicate, but all other similar questions did not take into account (mobile apps, iot's, web, 3rd party usage). Specifically, in dealing with the clients ...
3
votes
1answer
784 views

REST API Design: Multiple resources and authorization

I'm working on a service that forwards/unifies our API calls to external platforms/services. For example, let's say that I don't want to handle all possible actions (create post, retrieve post, edit ...
0
votes
1answer
138 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
51 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
1answer
2k views

Two way data synchronization between web application and REST API server

I have a web application and a REST API server (Microsoft Dynamics CRM 2016) that I don't have access to it's code, but I have access to the available resources. I need to create a data sync between ...
1
vote
3answers
242 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 ...
22
votes
4answers
34k views

What is the need of Odata when I have JSON?

I am trying to understand the point of Odata and when it would make sense. Right now how I work is I use ASP.NET and MVC/WebApi controller to serialize/deserialize objects into JSON and have ...
0
votes
0answers
187 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 ...
5
votes
1answer
534 views

What is the best way to store and manage client <> server <> server and back session information and authorisation?

I have scenario, where I have javascript front-end connected using AJAX communicating with Django-Rest-Framework backend. Users authenticate using JWT tokens. Backend is acting as chatbot and ...