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
2 votes
1 answer
294 views

What do you call the combination of endpoint and HTTP method in a REST API?

Let's use the Twitter API as an example. My understanding is that we refer to /statuses/update as an endpoint and we refer to POST as a HTTP method. So what would term do you use to refer to the pair ...
user avatar
  • 139
2 votes
3 answers
957 views

Back-end solution for pulling from CSV files

I'm building a data visualization that displays COVID information for the United States, at the city, state, and county level. The ultimate source of truth are three CSVs published by the New York ...
user avatar
1 vote
1 answer
106 views

What constitutes "identical" for the purposes of HTTP idempotence?

From RFC 7231 "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content" Section 4.2.2 "Idempotent Methods": A request method is considered "idempotent" if the ...
user avatar
  • 712
40 votes
1 answer
6k views

How to design a REST API that can "prompt" the client about long-running operations?

Say you were to develop a REST API that provides access to a set of complex, long-running, operations. The typical paradigm for an API like this (as I understand it) usually involves (the client) ...
user avatar
  • 511
1 vote
0 answers
73 views

Correct usage of ETags?

Currently my code makes a series of updates to some resource via a REST API but I also have some "rollback" logic that basically updates the resource to its original state before my updates ...
user avatar
  • 119
-2 votes
1 answer
317 views

What is a good strategy to determine the maximum number or items an api endpoint should handle?

I am developing a REST api endpoint that accepts a list of item IDs and will return some details for each item. Let's make the following assumptions Performance wise in the DB there is no significant ...
user avatar
  • 133
1 vote
0 answers
66 views

Best Way To Store Password & JWT on Mobile

I have a Flutter and Angular application that previously used Firebase, but for various reasons I'm working on switching it over to my own RESTful API with ExpressJS. One topic I'm a little confused ...
user avatar
  • 127
-5 votes
1 answer
82 views

Giving a fixed project price when REST is involved

Whenever I am asked to give a quote for a project that involves a remote REST API, I become very cautious. Most of the REST API's I worked with had a documentation, but it usually turned out to be ...
user avatar
  • 396
-2 votes
1 answer
24 views

RestAPI different json for list of items and item details

I have a RestAPI with two endpoints: /items - list of items /items/2 - selected by id, an item details returned json for list of items is { "id": "1", "name": "Max&...
user avatar
-3 votes
1 answer
95 views

REST API Testing best strategy

I'm currently developing a personal project using Django REST + React and as it grows more complex, I want to add unit testing to ensure that changes don't affect previous functionality. However, I'm ...
user avatar
0 votes
0 answers
46 views

REST API design: communicating order of inputs is important to the user (in POST request)

Let's say I have a REST endpoint where the order of inputs for a given field is important: POST Request: api.myrestendpoint.com/evolution-timeline/ inputs: {'this_list_should_be_ordered' : [ 'reptiles'...
user avatar
  • 131
-4 votes
1 answer
74 views

Which API building practice is better?

Im working on a ERP product, In which backend logics are to be APIs. Right now I have around 80 Tables. Proposal 1: Creating CRUD APIs for all tables and manipulation of data to be handled in front ...
user avatar
-1 votes
2 answers
325 views

Is it a good practice to have an endpoint URL with path parameter accepting different type of values according to an indicator in the HTTP header?

Assume a resource URL in the context of REST API: /sites/<site id or site code>/buildings/<building id or building code> The value of the two path parameters, <site id or site code> ...
user avatar
  • 1,467
5 votes
4 answers
857 views

Is it a good practice to have an endpoint URL with parameter accepting different type of values? [duplicate]

In my current maintenance project, there is REST API resource URL like this: /sites/<site id or site code>/buildings/<building id or building code> In this endpoint URL, there are two ...
user avatar
  • 1,467
2 votes
1 answer
170 views

How to handle db password change in a live service

Suppose I have a REST application running on a remote server which connects to a mysql database. Now let's say the password of the db has to be changed. What are the right methods and practices that ...
user avatar
0 votes
1 answer
69 views

RESTful Response when the POST request results in the creation of different kind of resources?

I have been working on designing an API that lets client create a product (think of product as something like website domain, something that comes into existence when client makes order for it to the ...
user avatar
1 vote
2 answers
81 views

Photo Library Service: What should be right way of photo library using AWS S3 and Java

I want to make a service that is supposed to upload Photos in S3 and make them available using a link. I have few design plans for my service. PLAN 1: Upload photo to my REST API which will update ...
user avatar
-1 votes
1 answer
896 views

Android Chat Application Architecture with websocket

I'm trying to build chat application in Android (future maybe webapp also) using websockets. The purpose of this project is to familiar with websockets, get know websockets and real time applications. ...
user avatar
0 votes
1 answer
54 views

How to abstract the communication protocol used to communicate between different microservices?

I would like to implement a microservice which can support both REST and SOAP, and will use the protocol based on the client preference (or what the client is already using). I have been thinking of ...
user avatar
0 votes
4 answers
186 views

When to throw error in response vs save error in database for POST API

I am creating a API to create Personnels of X city. Assume that there is a generalised service for creating personnel of any city and I want to call this service for X city personnels from my API. ...
user avatar
3 votes
1 answer
2k views

Multiple HttpClients in .NET Core Console Application

I'm building a .NET Core class library wrapper for a REST API that, ideally, could be used in both console applications and ASP.NET Core web applications. So far, I've based development on supporting ...
user avatar
1 vote
2 answers
659 views

Best way for resource (entity) relations loading in a REST API

We have a problem of load time in our REST API, which is the result of having Fat DTO (nested DTO s) & the N+1 problem (which is off my question), means that we are loading too much data in one ...
user avatar
  • 119
0 votes
1 answer
250 views

Is this an anti-pattern to have a service have both APIs and listening to events?

I am planning to make a service which will have simple REST APIs and will have a database in backend. I also wanted to add a logic to listen to notifications emitted by other service and there is some ...
user avatar
-3 votes
2 answers
109 views

How do I organize my REST API codes along with the codes for generating the website?

Using github as an example, www.github.com is the website people visit and api.github.com is the REST api server programs will visit. But they probably share some codebase and in my case they share a ...
user avatar
0 votes
1 answer
215 views

Different fields for GET and POST methods in REST

I have a collection /users/{userId}/tools and I want to GET and POST to that collection. Can I have different representation of that object based on the method? For example, for POST I want to send ...
user avatar
-4 votes
1 answer
118 views

Does it makes sense to implement a REST API for every app?

Is it mandatory to implement a REST API even if it doesn't make sense? I have created an app consuming REST services from other apps. Now that I have the final result, I wonder if it is needed to ...
user avatar
0 votes
1 answer
224 views

How do I stay RESTful when I have two child resources that need to change state independently of a parent?

I have three resource types - character, word, and write (these are three separate database tables, with word and write having a foreign key dependency on character). When character is created (upon ...
user avatar
1 vote
1 answer
325 views

SPA Routing with a RESTful API using HATEOAS

When using routing in a SPA web app (angular, react, etc), the user doesn't have to start at the entry point of the application. They can use a URL in the browser to drill down into any part of the ...
user avatar
  • 292
0 votes
1 answer
80 views

REST action as part of request body - action not stored alongside entity

I am working on an API that allows a client document to updated under the endpoint of PUT /client/{documentId}. As part of this document, I need to include an extra field 'ReplicateInManager' that ...
user avatar
1 vote
1 answer
243 views

SDK design: Should I parse enum as string or as enum?

I am building a SDK that will simplify the use of my API. The problem is if when I have to return property of type enum. For example, I use strings instead of int for displaying enum such as { "...
user avatar
  • 735
1 vote
0 answers
99 views

API Design (RPC - RESTful)

I'm new to API design. I've been reading numerous threads RESTful vs RPC patterns for API design, but I feel like none directly addressed my exact use case, so I just wanted to get a second opinion. ...
user avatar
  • 11
0 votes
2 answers
486 views

Should we return a HTTP 404 or 400 for a customer record that doesn't exist? [duplicate]

I am creating a service to get the total yearly expenditure of a customer. The service input is the customer ID. If a customer that does not exist is received at the service, should a 404 (Not found) ...
user avatar
  • 27
0 votes
1 answer
225 views

HATEOAS with Child Resources

Suppose Person has a Car. Car is a separate resource with its own URI. For the sake of this example, assume a person can only have one car. We want to include the Person's Car in the response when ...
user avatar
  • 292
0 votes
0 answers
57 views

RESTful query parameter at GET method

If I have a GET restful api use for query user info by user name. I don't want to return all column. My response column is decide to client. Example. My user have many column.(userName, sex, phone, ...
user avatar
  • 1
0 votes
2 answers
134 views

Is it an anti-pattern for a REST-ful API object to contain different fields depending on context?

I'm working on an API that allows users to invite each other for events. When someone is searching for users to invite, I want to include in the response information about whether a user has already ...
user avatar
  • 162
-4 votes
1 answer
43 views

How would I authenticating a Software Plugin with Username/Password using REST?

I'm developing my first Python plugin for a 3D application. What I'm looking to do I would like users who've purchased a subscription to the plugin from my Wordpress/WooCommerce web site to log in ...
user avatar
-3 votes
2 answers
66 views

Is a toggle side affect or propagation side affect, Restful?

We have a case where as it stands our API looks like api/workOptions/{workOptionsId}/items/{workOptionId} There exists business logic that only one workOptionId can have a status of "preferred." ...
user avatar
0 votes
0 answers
437 views

DRY(Don't repeat yourself) Principle and BFFs (Backend-for-Frontend)

We are about to plan our server architecture and we want to use the BFF strategy with node.js servers to serve multiple front-end apps. However we also want to be able to scale easily (e.g. a new ...
user avatar
  • 61
1 vote
3 answers
2k views

Is it bad practice to in a REST API to use Form Data in POST requests when all responses are in JSON?

When developing a REST API, is it ok to use Form-Data in POST requests or is that frowned upon? All my methods return a JSON body or only an HTTP code, should this be extended to my POST and PUT ...
user avatar
2 votes
1 answer
356 views

Long running REST API in PHP, async?

I have a RESTful API built with PHP. In POST request saving to DB is triggered. The problem is that now I have to support long running tasks. For example a user triggers POST request that is going to ...
user avatar
1 vote
2 answers
163 views

Rest API relationship design

I have a question in regards to designing relationships in REST API's. Imagine I have a relationship like in this diagram Now, should I show the relationship in the team endpoint like this? /v1/...
user avatar
0 votes
3 answers
498 views

Calling Microservice using REST or dedicated client jar

When microservices need to talk with each other, the common practice will be to have some REST (or gRPC) communication. I'm wondering what should be a better approach? (let's assume all services are ...
user avatar
  • 267
0 votes
2 answers
1k views

@OneToMany relationship in a microservice environment

I am coming from a typical monolithic background and I've been experimenting a lot with Spring Framework. I have also build some simple microservices communicating with each other etc. Now I want to ...
user avatar
4 votes
1 answer
3k views

Designing a REST API resource with a non-unique ID, but unique composite ID

Is it bad for a REST API to have non-unique ID for a child resource? For example, the endpoint is: GET /parent/:parent_name/child/:child_name The :parent_name is unique, but a :child_name is only ...
user avatar
0 votes
2 answers
55 views

API GET Request: Annotating data that the user hasn't seen before without breaking GET rules

I am implementing a feature in an app where a user can unlock achievements, and when the client requests what achievements the user has unlocked, the client needs to know the user hasn't seen it ...
user avatar
2 votes
1 answer
95 views

REST API: is it a violation of naming convention if a GET method changes the expiry of the a redis key?

I have proposed a REST API called 'getSessionState' which basically a backend API that retrieves some state info from a redis server and return to the clients. Because the state data is kept in a ...
user avatar
2 votes
1 answer
114 views

Handling OAuth 2.0 access token

I am creating a rest template to consume REST API secured by OAuth 2.0. The provider has implemented an expiry for the access token for 5 mins. So Using the rest template, I will be calling the ...
user avatar
2 votes
3 answers
213 views

Securing REST API with authenticated user

I want to build a REST API but I have some holes when it comes to the security part. I would like to get my head around how to authenticate the calls to the API. Therefore, this is my first draft for ...
user avatar
  • 145
1 vote
3 answers
144 views

Should we consider immutability for local scoped variables

I have the following code: const string endPoint = @"foo{0}?pageNum={1}&itemsPerPage={2}"; const int itemsPerPage = xxx; InvoiceCollection response = await _apiClient .GetAsync<...
user avatar
  • 215
3 votes
1 answer
695 views

Why not OData in public business APIs?

I hope I'm directing this very general question to the right audience. If not, don't hesitate to redirect me elsewhere is possible. I'm part of an initiative at a large company that is starting its ...
user avatar

1
3 4
5
6 7
30