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
-5
votes
0answers
12 views

How to maintain session in Restful Webservices

Angular Spring Restfull Webservices integration. I am using third party application for logging into my angular application. My Angular application will get response from Restfull webservices and ...
0
votes
0answers
25 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'...
-4
votes
1answer
55 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 ...
0
votes
0answers
29 views

Better understanding SRP: service for querying a REST api

I have a controller that receives some REQUEST parameters. These are forwarded to an importer service class. The importer then connects to a remote REST api which in turn will respond with a list of ...
0
votes
1answer
63 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> ...
5
votes
4answers
419 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 ...
2
votes
1answer
83 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 ...
0
votes
1answer
56 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 ...
0
votes
1answer
32 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 ...
-1
votes
1answer
32 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. ...
0
votes
0answers
34 views

Using a message queue or pub / sub solution for connecting frontend to backend instead of REST APIs

I own a dell r620 server at home and want to make more use of it. Typically its my staging environment as my internet is currently ipv6 with dslite so I can’t port forward. But I can easily call and ...
0
votes
1answer
40 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 ...
0
votes
4answers
45 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. ...
2
votes
1answer
146 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 ...
0
votes
1answer
61 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 ...
0
votes
0answers
44 views

Creating a microservice REST api to offload CPU intensive tasks from node.js

I am building a game which has rooms with clients connected. Each room has it's own websocket. At the end of the game, some calculation needs to be made about who won and it's a complicated math CPU ...
0
votes
1answer
100 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 ...
-3
votes
2answers
59 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 ...
0
votes
1answer
70 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 ...
-4
votes
1answer
90 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 ...
0
votes
1answer
56 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 ...
0
votes
1answer
67 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 ...
0
votes
1answer
40 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 ...
1
vote
1answer
90 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 { "...
1
vote
0answers
69 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. ...
0
votes
0answers
17 views

Aggregate small spring-boot REST services into a big one as dependencies

I have build several small REST services based on spring-boot. Each of this REST service has an own database, own configuration and can run independently without the other services. Each service is ...
0
votes
2answers
112 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) ...
0
votes
1answer
66 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 ...
0
votes
0answers
19 views

Can we create any number of model Objects in Spring web application?

In my methods of Service class, I need to do both Rest call and Database update, but the problem is, input of both these are different. Currently, I already have 2 model objects (say Employee for DB, ...
0
votes
0answers
15 views

Unity3d app as web client

Background Having the client web application and the server on the same network is safer, as one can expose the server ports only within the network, instead of making them publicly available. I ...
0
votes
0answers
53 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, ...
0
votes
2answers
112 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 ...
-4
votes
1answer
31 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 ...
-3
votes
2answers
64 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." ...
0
votes
0answers
252 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 ...
-1
votes
2answers
50 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 ...
1
vote
1answer
61 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 ...
0
votes
2answers
67 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/...
0
votes
2answers
55 views

Calling Microserice 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 ...
-2
votes
2answers
99 views

@OneToMany relationship in a microservice enviroment

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 ...
3
votes
1answer
197 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 ...
0
votes
2answers
53 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 ...
2
votes
1answer
78 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 ...
2
votes
1answer
73 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 ...
2
votes
3answers
165 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 ...
1
vote
3answers
131 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<...
1
vote
1answer
117 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 ...
0
votes
2answers
147 views

Microservices based API, how to handle long lists requests

I was planing to create an API based on microservices, I'm stuck on how to solve a specific scenario. Initial plan is, all microservices are only accessible through a REST API. Based on the next ...
-1
votes
2answers
62 views

Http status and reponse in case the API gives out partial response

I have an API whose job is to aggregate resources obtained by calling multiple other APIs and then give out the aggregated response to the client. Currently even if one or more dependent API calls ...
2
votes
3answers
171 views

What would be a RESTful URL pattern for a date range?

As I understand it, RESTful URL is more like a resource locator than a command. For example, to get user 1234, you wouldn't use this: //Not restful https://server/GetUser?UserID=1234 You would use ...

1
2 3 4 5
26