[Solved] PlayerDB API Post Requests bring 404

If you are getting error messages from the API like this: {“message”: “”, “code”: “api.404”, “data”: {}, “success”: false, “error”: false} try requesting each UUID seperately and once you have gotten a good response, try running it with your program. It seems that the API caches UUIDs that have been asked for the first time, … Read more

[Solved] Android-RESTful Services

There a number of REST libraries that do more or less for you. Arguably, the most popular for Android are Retrofit (https://github.com/square/retrofit) and my personal favourite RoboSpice (https://github.com/stephanenicolas/robospice) for two simple reasons: runs as a service and works alongside Activity lifecycle. Answering which one is the best would start a flame war. Keep in mind … Read more

[Solved] How to consume a json object in PHP

There are two steps to take: 1. load the JSON data 2. understand the JSON data 3. load the data in a database Your code appears to load the JOSN data using curl. In my experience, curl is powerful but complex for beginners. Probable file_get_contents() http://php.net/manual/en/function.file-get-contents.php works as well and is more easy. e.g. $json_data … Read more

[Solved] Creating Requests to an API in Java

Ok first open a gradle project and add these dependencies: implementation ‘com.google.code.gson:gson:2.8.5’ implementation ‘com.squareup.retrofit2:retrofit:2.4.0’ implementation ‘com.squareup.retrofit2:converter-gson:2.4.0’ Then make an interface for api calls: I have created a dummy for you: import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Query; import java.util.List; public interface Api { @GET(“/state”) Call<List<String>> groupList(@Query(“id”) int groupId); } Then add another class for retrofitclient: import … Read more

[Solved] How to call third party Restful API [closed]

The problem is that you are mixing up options of the library with HTTP headers. Try with this instead: public static void Main (string[] args) { string url = “https://dashboard.reviewpush.com/api/company/locations”; using (var client = new WebClient()) { client.Headers[HttpRequestHeader.ContentType] = “application/json”; client.Headers[“X-Api-Key”] = “key”; client.Headers[“X-Api-Secret”] = “secret”; string s = client.DownloadString(url); Console.WriteLine(s); } } You might … Read more

[Solved] Should REST APIs for updating a map allow setting the map to empty? [closed]

This is less a question targeted towards REST then it is actually targeting HTTP as the default transport protocol used by applications following a REST architecture approach. According to RFC 7231 4.3.4 a server SHOULD verify that the PUT representation is consistent with any constraints the server has for the target resource that cannot or … Read more