Parsing Json .Net Web Api
I'm new with Web API 2 / Entity Framework 6 project, I'm making REST services, but for one specific service I'm going to receive (via Post) a JSON before making any CRUD operations over any entity of...
View ArticleUnit testing a REST API in Java and Spring
I have a simple Java Spring REST API application and i don't know how can i unit test it. I have read the documentations of JUnit and Mockito, but i couldn't figure it out.Here is the post method in...
View ArticleWhat should be the REST endpoints naming convention when the User ID is...
Consider following scenario:I have some endpoints:/api/v1/users/{userId}/api/v1/users/{userId}/productsNow when we use OAuth2, most of the time, the user ID is present in the Authentication token...
View ArticleRest API for Kafka
I need to write a REST API for kafka which can read or write data from consumer/producer respectively.How can I do so?
View ArticleWhat is a recommended design pattern for processing data from an API response...
My Yii2 application (in PHP 7, so unfortunately I do not have strict types) receives from an API call responses which should be nested arrays looking like:$response = ['session' => ['userData' =>...
View ArticleMaking an API Request with python based on Mozilla Authentication
I'm creating a class called AnbimaApiClient , aiming to facilitate data requests for the Anbima API (api documentation link: https://developers.anbima.com.br/en/autenticacao/). I've successfully...
View ArticleUnknown Guild error when retrieving Guild (Server) from Discord's API
I'm trying to retrieve the details of a Discord Server: curl -X GET -H "Authorization: Bot mytoken" -H "Content-Type: application/json" https://discord.com/api/guilds/662267976984297473However, I get...
View ArticleREST: Resource in wrong state -- Which HTTP status should I return?
Assume my server exposes resources which have a state (Not approved, Approved, Auto-approved). If a resource is in state Not approved it should not be accessible to clients, i.e. clients are allowed to...
View ArticleCoinbase Advance Trading API returns "Error: account not available" when...
For the past while I have been trying to get this crypto trading bot to work. The problem is that while I can get/list accounts when I place an order I get a 400 error.The code:def place_order(symbol,...
View ArticleHow do I retrieve query parameters in a Spring Boot controller?
I am developing a project using Spring Boot. I've a controller which accepts GET requests.Currently I'm accepting requests to the following kind of URLs:http://localhost:8888/user/data/002but I want to...
View ArticleHow to use jti claim in a JWT
The JWT spec mentions a jti claim which allegedly can be used as a nonce to prevent replay attacks:The "jti" (JWT ID) claim provides a unique identifier for the JWT. The identifier value MUST be...
View ArticleIs GitHub throttling my clone/download speed? [closed]
I've been noticing lately that when I clone large repositories from GitHub, the download speed sometimes drops really low — around 100-200 KiB/s. Normally, I get much faster speeds (several MB/s), so...
View Article422 or 409 status code for existing email during signup
I am building RESTful API and I have come across a situation. During user sign up, if the email already exists then between 422 and 409 which http response code makes sense?I have browsed through...
View ArticleFetch Record from MongoDB in descending order?
Not able to sort the documents in descending order on last updated time stamp if the documents having the January and February records. how to get the documents in descending orderQuery query= new...
View ArticlePostman and content-length
From my laptop I initiated a POST request to my web server. The HTTP POST request looks something like this (when seen via POSTMAN console)POST /api/fwupgrade HTTP/1.1User-Agent:...
View ArticleMultipartException: Current request is not a multipart request
I am trying to make a restful controller to upload files. I have seen thisand made this controller:@RestControllerpublic class MaterialController { @RequestMapping(value="/upload", method=...
View ArticleLinkedIn API returns 403 ACCESS_DENIED on /me and /emailAddress with valid...
I'm developing an application called Investor Estate, and I'm implementing the LinkedIn OAuth 2.0 login flow.I've successfully retrieved an access token using the following...
View ArticleHow-to perform a simple AWS/EC2 rest API call with Curl
Has anyone used cUrl to manage the AWS (EC2) rest API? Here I picked the simplest possible call, listing running instances. Am I missing something or am I clearly showing ignorance of proper cUrl...
View ArticleHow to set a tag for a user in one signal with rest api
According to one signal documentation tag can be set with rest API:Tags are data attributes that can be added to users via OneSignal SDKs or the Server REST API.but there is no more data, about how to...
View ArticleHow to use Spring OAuth2 JWT Token?
We want use the Spring OAuth2 JWT Token support. Our architecture is as follows: Spring just provides a REST-interface and the frontend is built with AngularJS which queries the Spring-REST-Interface....
View Article