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

API key vs Per User Auth for B2B Transactions on Restful Service [on hold]

I've been asked to think about how to secure a restful service that (at least for now) will require 3rd party B2B applications to authenticate. My understanding is that API keys are basically a token ...
1
vote
1answer
46 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 ...
0
votes
1answer
16 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
31 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
104 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
491 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
132 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
27 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
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 ...
0
votes
1answer
39 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. Cutsomer, Employee, Fruits,.. what ever. what should be retruned when ...
-1
votes
0answers
18 views

Modelling a REST API for a form base input system [closed]

I'm working on a backend for a form based input application. Forms has templates, each form instance is based on a template. So i have come up with following resource endpoints /templates /forms ...
1
vote
2answers
178 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
92 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
1answer
125 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/...
-1
votes
0answers
22 views

How do I reference a library fragment from a main raml file?

I have a main raml file, and I have a library fragment file. The fragment file contains all of my data types. I want to reference this fragment from the main file, but I am getting an "Unresolved ...
1
vote
0answers
58 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
386 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
47 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
61 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 ...
0
votes
0answers
37 views

How do I assign methods if I have 100 endpoints in a RAML spec?

I'm trying to build a RAML API specification for the first time. The API will need to give users access to 100 resources (endpoints), so I'm not sure how to assign methods to them. I assume there has ...
1
vote
0answers
18 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
74 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
89 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 ...
-2
votes
2answers
136 views

Confused about how APIs are called

I'm new to APIs. Conceptually, I understand what an API is, but I get confused when it comes to the some of the technical details. All of the tutorials I've read talk about URLs and endpoints, and ...
-1
votes
1answer
67 views

How to handle major changes (cross-cutting concerns) in REST API?

Let's say we have a REST API application A consumed by other 30 applications. Application "A" uses a cross-cutting security implementation using a Security NuGet package 1.0. All minor/major changes ...
18
votes
4answers
18k 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. ...
0
votes
0answers
42 views

In a DDD CQRS API, is it preferable to have a separate DTO per query or per representation of a resource?

I am in the middle of starting up a new project and just wanted some reassurance as to which approach to DTO's returned by the read-side was easier to maintain in a real world application with ...
1
vote
1answer
48 views

How do I create an HTTP PUT request that modifies the resource in many ways

I have a NodeJs backend that interacts with MySQL database. Let us assume that I have a schema similar to this: Book id name Author id book_id name So, I have two tables named Book and ...
1
vote
1answer
38 views

Ideal architecture for ML training -> API service workflow, with multiple models/services? [closed]

I'm planning to construct a workflow/environment for training and serving NLP classifiers, that follows something like: The model training system takes in annotated documents from a subset of a ...
1
vote
2answers
556 views

Is serverless architecture a good fit for Django Rest Framework app?

I am building a web/mobile application with Django Rest Framework (DRF) that enables authenticated users to post snippets and/or vote for other user's snippets. All users (authenticated or not) can ...
1
vote
2answers
82 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 ...
0
votes
2answers
159 views

Rest API POST with illegal data in parameters: Bad Request or 404?

Take a hypothetical camera company providing an API to manage its users and cameras. Each user owns cameras, and every user of a camera has a role assigned (one of admin, operator, viewer - these are ...
0
votes
1answer
112 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
2answers
258 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 ...
-1
votes
1answer
76 views

Is there a reason to have multiple projects for a single API? [closed]

I entered yesterday to my new job and while browsing their repositories, I noticed they have a project for every resource of a REST API. For example, if they need to add a REST resource called "people"...
0
votes
1answer
44 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. ...
2
votes
2answers
922 views

Rest api with a hello resource / main entry point

I'm designing a Rest API for our web application. There's one idea that came to my mind today and I haven't found in recent searches: a "hello" resource, where clients are supposed to connect as the ...
-1
votes
1answer
18 views

Adding resources to subresource REST API

I'm trying to build an web API that closely represents a library of books. I currently have the following routes. GET /api/books GET /api/books/:bookID GET /api/libraries POST /api/libraries This ...
1
vote
2answers
111 views

Status code for middleware? 200 or 4XX , 5XX?

I have a design dilemma in deciding the response status code and architecture for a middleware we are designing. So the Client Calls MiddleWare, And middleware calls the 3rd party service to get car-...
10
votes
3answers
8k views

How to consume external RESTful API with Symfony?

We are building a Microservice architecture for our projects, with mostly front-end Symfony applications interacting with back-end RESTful APIs. The problem is this approach is breaking the Symfony ...
-1
votes
1answer
59 views

Resful name API for multiple key objects

We are implementing an API and we want to follow best practices for naming the endpoints. However, during the design, we have found a challenge. We have some objects where the key to the objects is a ...
0
votes
1answer
44 views

rest service with digitally signed parameters

I'd like to build a rest service that will accept objects that has digital signature. This service has to support both xml and json data serialization formats. I'd like to use .Net core framework to ...
1
vote
2answers
67 views

Acceptable to use synchronous call to another microservice for time-sensitve state change?

Say there are two microservices (example is simplified) PickupRequestService: lists pick-up requests of passengers DriverService: drivers use to accept pickup requests On a completely decoupled ...
0
votes
2answers
81 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 ...
12
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 ...
0
votes
2answers
80 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 ...
-2
votes
2answers
130 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/...