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
1
vote
5answers
280 views

Is it acceptable to accept multiple results in a unit test?

I've noticed this while implementing a Rest-API today. We first define interfaces for each API method and the api contract for one endpoint allows (amongst others) two status codes: 200 and 204. Both ...
4
votes
2answers
103 views

client / server division of responsibility

It makes sense to give the server applications as much responsibility as posibible as to avoid having to rewrite logic across different types of clients. In my case i am developing a data structure ...
-4
votes
0answers
25 views

Calling SOAP endpoint in browser using Angular/React http api libraries? [on hold]

I want to call SOAP endpoints in browser using Angular/React libraries. Seems like it is possible to do so like shown in the example here. If you have done that please list the problems you have ...
0
votes
2answers
96 views

Is creating ViewModels in Web API a bad practice?

So, somebody at work who is twice as experienced than I am, told us that we must not create ViewModel classes within Web API. (We are using Angular for UI) In his opinion ViewModel is ASP.NET MVC ...
1
vote
4answers
106 views

What's the ideal way to send a success message in the response of a HATEOAS Rest Api?

I am using HATEOAS architecture in my rest application and want to send internationalized success message that will be directly consumed by the client. I know we can just add a key in the response but ...
34
votes
5answers
51k views

RESTful API. Should I be returning the object that was created / updated?

I'm designing a RESTful web service using WebApi and was wondering what HTTP responses and response bodies to return when updating / creating objects. For example I can use the POST method to send ...
1
vote
4answers
136 views

Cron Job Microservice

I'm implementing an application that's made of bunch of microservices. Each of them is fairly simple, focusing on its own task. Let's call two of them Service A and Service B. They are both ...
5
votes
2answers
3k views

Good way to handle the notification counter like Facebook does

I want to build a similar notification mechanism that Facebook handles. I actually store the user's notification in an SQL table (actually it's a graph database but everybody master RDBMS terms). I'...
2
votes
0answers
15 views

How to implement SAML Authentication SPA and REST Backend

Developing a SPA (with VueJS) that is talking to our own REST API Backend(Separate server). Normal authentication flow in the SPA: User credentials after submission are sent to the backend and if ...
0
votes
2answers
185 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 ...
2
votes
3answers
135 views

REST API: what should PUT do with complex objects?

Let's suppose I have the following objects in my domain: class Warehouse { int Id; string Address; Item[] Inventory; } class Item { int Id; string Name; int Price; int ...
1
vote
1answer
55 views

Abstracting common functionality for REST and CLI

I have made an application that deals with collections of images. Currently it has a REST api to add/remove images, create/clear/delete collections and a worker that can automatically fetch images ...
15
votes
1answer
8k views

RESTful API and i18n: how to design the response?

We are designing a RESTful API that is mainly intended to meet the needs of a single client. Because of its very particular circumstances, this client has to make as few requests as possible. The ...
1
vote
1answer
70 views

Bounded contexts and domain-wide public REST API

I'm prototyping out an application here where I'm using domain-driven design to identify the domain(s) of the application and I've ended up with something that - at least so far - feels like a fairly ...
2
votes
2answers
117 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 ...
4
votes
4answers
1k views

Idempotency and concurrency in a REST web service

Is concurrency and idempotency mutually exclusive for a REST web service or can it be done so a service can be both concurrent and idempotent? Using a optimistic lock methodology like using Version ...
1
vote
1answer
271 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 ...
0
votes
2answers
87 views

REST API Input Validation Strategy

I am implementing a REST API and need to validate the JSON API inputs for the CREATE and UPDATE endpoints. The goal is to send a 400 error prior to doing any processing if the inputs are not valid. ...
0
votes
1answer
80 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
265 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
111 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 ...
0
votes
2answers
124 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 ...
2
votes
1answer
50 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
245 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
vote
2answers
75 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, ...
2
votes
1answer
161 views

Which setup is more REST abiding?

I want to create an endpoint for "logging out". Logging out in my case is basically removing an access token from the database. Therefore DELETE verb makes sense here, something like this: DELETE URL/...
0
votes
3answers
79 views

Should a composition be considered a resource in REST?

Consider this example system consisting of the following resources: Family, Person and Role. A Family and Person has a many-many relationship and each family member has a certain "role". For example, ...
0
votes
1answer
28 views

Image upload workflow azure

I'm working on a new project. It is a smartphone application made with react-native. In the app, you can create "cards" which are having a title, a description and a photo, taken by the user's phone. ...
1
vote
1answer
22 views

Expose resource as child of its parent or not?

Say every word belongs to a dictionary. What's the preferable URI for a single word, either /word/:word (with dictionary_id a required GET parameter), or /dictionary/:id/word/:word? I'm thinking the ...
0
votes
1answer
63 views

API design refrence , Empty list response (REST, SOAP, …) type compatibility

Not sure where to go for an authoritive/text book answer for this question. Suppose a service returns a list of something e.g. Customer, Employee, Fruits, etc. What should be returned when the list ...
0
votes
1answer
53 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.
4
votes
1answer
889 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 ...
1
vote
1answer
23 views

Represent nested resources that has two different type (entites) owners in REST APIs?

Suppose I have a entity called Appointment. This entity represents an medical appointment between one Doctor and one Patient. To create a new Appointment, I send somethind like: POST /appointments {...
-3
votes
1answer
35 views

An entity belongs to another entity. Should a REST API provide just the ID of its parent, or its endpoint?

Say a dictionary belongs to a language. For the endpoint dictionary/{id}, which is preferable out of: {..., 'language_id': {id}, ...} and: {..., 'language': '/language/{id}', ...} ?
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
1answer
112 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. ...
3
votes
3answers
556 views

How to handle “Optimistic Locking” on a collection with ETag headers?

Consider endpoint /projects that returns a list of projects with the following headers: HTTP/1.1 200 OK Etag: "superEtag" The etag value represents a hash of the entire collection and it does not ...
2
votes
2answers
137 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 ...
0
votes
1answer
55 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
2answers
180 views

API design for actions (lifecycle, conversion, etc.)

How can I design a good REST API for actions, like in the following cases? lifecycle start a device stop a device ... conversions convert a file from one format to another In both cases I would ...
3
votes
3answers
97 views

Delete user data or replace it with empty resource?

Say, we have a public facing REST API which lets user manipulate data using POST, GET and DELETE. The API is exposed via Service A which at the backend calls Service B where most of the business logic ...
3
votes
2answers
1k views

REST API Structure to request multiple items

I have a REST API that looks something like the below where a person can belong to an organisation (but doesn't have to) and a person has many items. The items may also belong to the organisation ...
1
vote
0answers
59 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 ...
8
votes
2answers
414 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 ...
0
votes
1answer
52 views

Designing Rest API endpoint for viewing bearer access token

We have several endpoints which were authenticated using a bearer access-token. There was another endpoint which will renew/generate a new bearer access-token on passing valid secret_id and client_id. ...
-2
votes
1answer
65 views

Connecting microservices with each other [closed]

My only skepticism about using microservices over REST /HTTP is that there could be a performance drop. Using too many microservices over REST, with a REST connection, the data would always first need ...
0
votes
1answer
114 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
0answers
24 views

Should custom Django Admin be separate from client endpoints?

I am currently in the process of creating a Django REST framework project for a client server web app. I would like to ask the following: Should I write a custom admin if I want my app to be ...
1
vote
2answers
79 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
94 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 ...