Click here to Skip to main content
15,890,185 members
Everything / API

API

API

Great Reads

by Shenwei Liu
A complete sample application using AngularJS, trNgGrid, ngTable, and ASP.NET Web API to access and display data with server-side data filtering, sorting, and paging.
by Bruno Tabbia
Automatic positioning and resizing of explorer windows, without overlapping (for obsessive superusers)
by Mathew Soji
This tip guides through implementing a basic REST based Web API service with multiple GET methods and its consumption using JQuery client
by Sheshnath Kumar
This article will find out a solution to serialize/deserialize object by reference at server and client, also will serialize/deserialize objects having circular references.

Latest Articles

by Fred Song (Melbourne)
A responsive React frontend interacts in real-time with a .NET 8 Minimal API backend to dynamically display and manage state transitions for a simulated traffic light system.
by Dev Leader
Access Google Sheets via C#; Start simple, optimize later!
by Nicolas DESCARTES
How to build a GraphQL API with HotChocolate?
by Pawan Kumar from CodewithPawan.com
Explore the seamless integration of @ngrx/translate with an Angular standalone API in this comprehensive guide, ensuring a smooth translation workflow for your applications.

All Articles

Sort by Updated

API 

U 30 Apr 2024 by Fred Song (Melbourne)
A responsive React frontend interacts in real-time with a .NET 8 Minimal API backend to dynamically display and manage state transitions for a simulated traffic light system.
21 Mar 2024 by johntk22
make sure that the event listener for the add to cart and show cart is added correctly and the id in the JavaScript code match the id of button in the HTML.
20 Mar 2024 by Andre Oosthuizen
Quote: Once the user clicks on the action, it should not work for the second time. Based on this it seems that you already check and save the record with a true/false returned value. It further seems that when a user clicks on the link/button a...
20 Mar 2024 by Dave Kreskowiak
It's not entirely clear what you're doing or even how this email is sent or what you expect to happen when the user gets the email. But, generically, if the user has to approve something on a website, you would include a link in the email that...
19 Mar 2024 by Graeme_Grant
Quote: No I'm not asking to do my work. I'm asking for an approach or idea which I can implement in my application. The concept would be to have the following in a table in your db: * user Id * Job Id (Guid) used in the link for the email * Job...
19 Mar 2024 by Vaithilingam Alagappan
Hi, I have to implement a feature in our web application to capture the user action like approve/reject from email to database. Planned to trigger the email through scheduled job which contains Approve/Reject link or button. The user action...
16 Mar 2024 by Tyler Bakeman
In the JS file, there are some issues I noticed line 5: const showCartButton = document.querySelector('.show-cart'); -- The show-cart class does not exist in the html; instead, try: const showCartButton =...
25 Feb 2024 by Graeme_Grant
Here is a tool that will make it simple: JSON Utils: Generate C#, VB.Net, SQL Table and Java from JSON[^]. I have also written an article on working with JSON that list more tools and techniques: >Working with Newtonsoft.Json in C# & VB[^]
25 Feb 2024 by Computer Wiz99
I have a JSon that I need to create an API for in C# from D365. Is there any packages that can help me with this in C#? I have never created an API before in C# so this is new to me. What do I need to put into a control in C#? "d365EntityName":...
22 Feb 2024 by Dave Kreskowiak
Your question makes no sense. After you remove the packages, you're going to have to rewrite the code anyway to remove all the mentions of CrmEntity and D365. There is no getting around that. Since I have no idea what CrmEntity and D365 do, I...
22 Feb 2024 by Computer Wiz99
I have an API that I am working on with a package installed that has a library with CrmEntity and D365Field. I have never worked with API in C# before. I have to remove everything in the package and convert the current code to still run the same....
17 Feb 2024 by Dev Leader
Access Google Sheets via C#; Start simple, optimize later!
15 Feb 2024 by OriginalGriff
Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to...
15 Feb 2024 by sina heidari
I start to work on the GRCP project (client). when I run the project I can open the swagger and there are two APIs there. I searched very much to find out where these two APIs are!!! couldn't find!!!! This project is run on docker. The...
6 Feb 2024 by Nicolas DESCARTES
How to build a GraphQL API with HotChocolate?
4 Feb 2024 by fsobotka1995
Hello! I'm trying to connect my vb.net project to an external machine via api, to get and send data. The objetive will be reboot, poweroff, check status and open door. I have this code working on a similar equipment with 0 problems. In...
1 Feb 2024 by Shokri Francis raoof
I'm building a simple store website where I need the euro price converted into bitcoin when the total is shown in the shopping cart. Everything was working until I added the eur-btc API, but now the 'add to cart' and 'show cart' buttons arent...
31 Jan 2024 by Graeme_Grant
While waiting for you to update your question, I used your question in google search: How to append new node in existing XML through api C#[^] and there were many answers to the same question: * C#, XML, adding new nodes - StackOverflow[^] *...
31 Jan 2024 by OriginalGriff
XML (and JSON) are Text based data transfer formats: the only practical way to add a new node is to read the XML file into an XMLDocument (or equivalent), add the node to that, and save the XML file again. You can't just open the "raw" XML as...
31 Jan 2024 by Diku241
I want to append new node into existing xml file, data that is coming from api of json type independently from model class elements should be append into the file. What I have tried: I have tried many ways but not done please give reply
13 Jan 2024 by Pawan Kumar from CodewithPawan.com
Explore the seamless integration of @ngrx/translate with an Angular standalone API in this comprehensive guide, ensuring a smooth translation workflow for your applications.
19 Dec 2023 by Richard Deeming
Since your repository code is swallowing all exceptions - an extremely bad idea, by the way! - the only reason for a NullReferenceException would be that the baseRepository is null. Check the constructor to make sure you've assigned the field...
18 Dec 2023 by A Belal
in Repository Pattern System.NullReferenceException Delete Method System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Microsoft.EntityFrameworkCore StackTrace: at...
18 Dec 2023 by M Imran Ansari
As the error message, the issue is in Delete method. The Delete method attempts to remove an entity from the context using LapShopContext.Set().Remove(entity). However, the error you're encountering is a NullReferenceException, which suggests...
29 Nov 2023 by Dave Kreskowiak
Nothing is displayed because the code stops running when the error is thrown. In javascript, the error "Cannot read properties of undefined" means you're trying to call a method or property of a variable that does not hold an object. You're...
29 Nov 2023 by A Belal
i want to do Pagination for View Page named ItemsList data comes well in Console in browser but it doesn't show on screen What I have tried: Array(10) 0 : {itemId: 2, itemName: 'MacBook Pro', salesPrice: 1339.69, purchasePrice: 1205.72,...
26 Nov 2023 by Ram349
I am facing issue while consuming restful service POST method. It is showing Status code 0, but while am trying to give same request from POSTMAN rest client (A google chrome extension) it works fine. below is the code am using to post some data....
20 Nov 2023 by Richard Deeming
You have no [Authorize] attribute on your ValuesController or any of its actions. Unless you have some configuration that you haven't shown, all of those actions will allow anonymous callers. Simple authorization in ASP.NET Core | Microsoft Learn[^]
20 Nov 2023 by Andre Oosthuizen
Ok, so first - to run some error checking outside of your app, clear your browser cache or any other caching mechanisms that might be storing the old token as this might become an issue. I have converted your code to what I think might work,...
20 Nov 2023 by A Belal
I get tokenKey from path https://localhost:7107/api/login And when i try to test token and get data from Path https://localhost:7107/api/Values the token work good and data comes well but when i remove token the data continue come and...
20 Nov 2023 by samthelab
Okay OriginalGriff, RSVP I have written a C# front-end program, in which calls a bunch of DLL "C" functions(API's). and the communications between the two parts has been great. But recently, I was working on the program and must have done...
19 Nov 2023 by Dave Kreskowiak
Typically, "BadImageFormatException" means you're trying to mix 32- and 64-bit code in the same process. You're either trying to use 64-bit .DLL's in your app that's running as 32-bit, or you're trying to use 32-bit .DLL's in a 64-bit app. You...
6 Nov 2023 by Member 12330910
I'm trying to get access to the API of this page Past alerts[^] My idea is to develop an application displaying notification when a new alert is published and the list of alerts. What I have tried: ...
6 Nov 2023 by Pete O'Hanlon
Looking at the site, I don't think the past API is exposed. The page you see on screen looks to be rendered at the server, which suggests that the API is probably private. As Dave suggests, contact the owners of the site to see if there is a...
5 Nov 2023 by Dave Kreskowiak
Why are you asking us about an API and not the owners of the site? Nobody else is going to know anything about an API for that site except the owners of it. Or what is the real question? Are you asking how you get data from a web API? You could...
5 Nov 2023 by A Belal
I have a controller named Categories. I have one form or One View for Create And Edit. Create Action works well, but when I click Edit, the NewRow is added in database. The problem is I want to Edit Row without adding new in database. What I...
2 Oct 2023 by Member 9346617
I want to connect with API and get the response in JSON format. I need to put the username and password to connect to API. While I am hitting the url in browser and putting the username and password, I am able to get the response. But while I am...
1 Oct 2023 by samthelab
Today, I recently received an answer to a question that I didn't ask - on my cell-phone, regarding a question that I was going to ask. It was about obtaining the Network Domain/SSID name in "C" programmatically from/on a cell phone. But I'm...
29 Sep 2023 by Richard MacCutchan
See Native Wifi API Sample - Win32 apps | Microsoft Learn[^]
28 Sep 2023 by OriginalGriff
You will have to go back to the site you got the API from and look / ask there: there is no "single rule" to handle logins that all API's must use.
20 Sep 2023 by sajenson johnson
I have POS application in Laravel PHP. I need to show customer display. I have the customer display like Partner CD7220 UN model. I need the API or source code to connect the customer display with my PHP POS application. Can any one who has the...
19 Sep 2023 by OriginalGriff
You should talk to the people who created it - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
19 Sep 2023 by Member 8840306
I am new to Python.I have hugging face application SeamlessM4T at this link. I was trying to solve this problem using chatgpt. To create a Flask interface for translating speech to speech in different languages using the Hugging Face Shameless...
12 Sep 2023 by NoviceCoder871987
I ran into a weird issue with custom drawing the listview control. I drew the grid lines in response to CDDS_POSTPAINT notification. All working okay so far. However, when scrolling vertically, the lines will be messed up and will not be drawn at...
9 Sep 2023 by Richard MacCutchan
See About Custom Draw - Win32 apps | Microsoft Learn[^] for custom drawing in Report mode.
23 Aug 2023 by Skeleton0408
I was coding a script that calculates percentage differnce of binance's close data and upbit's close data. import time import pandas as pd import pyupbit import ccxt import requests time.sleep(3) binanceX = ccxt.binance(config={ ...
23 Aug 2023 by Andre Oosthuizen
Your issue might be related to the indexing of your 'gap_series DataFrame'. The '.tail(200)' method you are using is used to select the last 200 rows of your 'DataFrame', which might not be available for all coins at all times. This could result...
21 Aug 2023 by Pete O'Hanlon
Easy way to test HttpClient with Goldlight.HttpClientTestSupport
19 Aug 2023 by jaikrishna310
I am trying to make a project in spring-boot! But in the controller, I am getting an error in the save() method as follows: The method save(S) in the type CrudRepository is not applicable for the arguments...
17 Aug 2023 by Muhammad Anas 2023
The issue is with spring-data-jpa version, try changing to another version in pom.xml(if its maven) or you may use the below mentioned version if it works for your spring boot project version: ...
10 Aug 2023 by Shubham Agrawal 2023
``` var express = require("express"); var cors = require("cors"); var mongoClient = require("mongodb").MongoClient; var connectionString = "mongodb://127.0.0.1:27017"; var app = express(); app.use(cors()); app.use(express.urlencoded({ ...
9 Aug 2023 by Richard MacCutchan
I have reworked this to simplify the code so you can see how to manage overlapped operations, and capture the results correctly. #include #include #include int main() { HANDLE hFile = CreateFileA( ...
9 Aug 2023 by RexyCode
I'm trying to make an asynchronous IO operation work. However, both the WriteFile and ReadFile functions do not work; WriteFile doesn't print out prompt1 and ReadFile doesn't return chBuffer[200] so consequently the switch statement returns the...
6 Aug 2023 by RAHUL(10217975)
I have deployed a Python in IIS, Application working fine in my local machine. I am able to retrieve project_id value from below request.form in local machine code but in IIS its not working. request.form['projectdetails[project_id]'] I am...
1 Aug 2023 by MrJay994
Hello, I created an API in C++ using Poco Libraries. I also have a http request client that can perform requests on the server API. Both the API and the client are standalone programs running on the same machine Ubuntu. However, when I try to do...
17 Jul 2023 by MrJay994
I've created a C++ API in Ubuntu (following this tutorial https://levelup.gitconnected.com/building-an-api-in-c-with-pistache-413247535fd3) and I would like to secure it with OAuth 2 with POCO. ...
17 Jul 2023 by Richard MacCutchan
You were given some suggestions in your previous question on this subject at: How to secure my C++ API?[^]. Quote: Is there an example I could find on the internet Quite possibly; try asking one of the many search engines available.
14 Jul 2023 by Nick Van Tassell
I have a Web API project that has been working for about a year now. Yesterday it suddenly stopped working. It will not respond to any requests made from Swagger, Postman, or the Angular client specifically using this API. Swagger, Postman,...
13 Jul 2023 by Golden Basim
Hi, I developed a Windows form application using C# & MySQL, also I know about REST API in Node.js (express) and Laravel. I know it is different languages and may be different techniques. but, I want to add this feature to my C# Windows form...
13 Jul 2023 by Andre Oosthuizen
It is going to be difficult to find an all-in-one solution online for your requirements. You need to first draw up your mind-map requirements, break them down into little objects then start with creating each object accordingly. There are many...
13 Jul 2023 by Richard MacCutchan
The main problem that I can see is that you call the ioOperations which will return as soon as the WriteFile has started, since WriteFile returns false for overlapped IO. Returning the value of GetLastError from that call is pointless as your...
11 Jul 2023 by MrJay994
Hello, I have created an API in C++ in Ubuntu (using this tutorial https://levelup.gitconnected.com/building-an-api-in-c-with-pistache-413247535fd3) and I would need to secure it. I've read about OAuth, tokens and TLS (transport layer security),...
11 Jul 2023 by Andre Oosthuizen
As a high-level overview, there are a few steps you can follow - OAuth - There are a few framework/libraries that supports C++ on OAuth. POCO, OAuth2CPP, or CPP-REST-SDK are some options. We used POCO before, have a look at their libraries...
5 Jul 2023 by Graeme_Grant
I have not done FrameWork Web API for a while. However... How does Asp.Net match this: "Message": "The requested resource does not support http method 'POST'." to this? public IHttpActionResult PostString(string l) Try changing to: public...
5 Jul 2023 by Gaby94
Hi! I'm trying to make an API in ASP.NET Framework 4.6.1 (I know) and I'm having trouble at POST requests. I'm using Postman for testing. After I configure a post request and send it to the server and send it I recieved the error : { ...
5 Jul 2023 by Andre Oosthuizen
Before I will look at the code as the culprit, I will check the following first - 1) The route configuration in your 'WebApiConfig' class is set up to handle POST requests. You have defined your route as 'api/{controller}/{id}'. Make sure that...
24 Jun 2023 by Deltahun
I need to upload multiple large files in chunks using the following code: The first file of the foreach upload works correctly, but I encounter issues starting before the second file upload. The return type of $service->files->listFiles is...
24 Jun 2023 by Deltahun
I solved it by resetting "setDefer" to the client at the end of the loop: fclose($handle); $client->setDefer(false);
24 Jun 2023 by Andre Oosthuizen
Quote: is it possible to send multiple uploads simultaneously (async/parallel) - yes, it is but in my opinion, using parallel uploads in PHP with Google Drive API can be quite complex. I know that you can use PHP libraries or frameworks that...
8 Jun 2023 by Hassham Rajan
Hello, I want to use codeproject results such as it examines an image and elaborates how many individuals are there in the picture. these results are required outside to be used to create a heatmap. How can i do it. Thanks What I have tried: I...
8 Jun 2023 by Richard MacCutchan
Please post you question in the CodeProject.AI Discussions[^] forum.
29 May 2023 by Graeme_Grant
Based on how you ask this question strongly suggests that you need to use a 3rd-party library. Here is one that I recommend: ASP.NET Core Word Processor | WYSIWYG Document Editor |Syncfusion[^]. They have a Community License[^] that you most...
29 May 2023 by ajay.raju531
Hi, Users can upload word document and those are saved in project folder. My requirement is user can edit and save uploaded word document in browser. After save the word content need to export it as pdf. Any ideas will be appreciated. Thanks,...
25 May 2023 by Member 15418280
we are getting 403 in core webapi using certificate pfx we have hosted dotnet core api in iis. we are using certificate authentication in post method. we are getting 403 in postman. What I have tried: we are getting 403 in core webapi...
22 May 2023 by Luis M. Rojas
Hello The following Code works on another part, but here when the postasync it is executed its return to the try again and again. Any Help pls? #if DEBUG HttpClientHandler insecureHandler =...
22 May 2023 by Luis M. Rojas
The only solution was to insert the in the button_click even. Why? I do not know.
21 May 2023 by Dignity0
Help: the problem of realizing serial communication using Web Serial API. Every 1000ms, my sensor will send a piece of data with a format similar to "CH1CH2CH3: 2.408130 2.456470 13152-1552 9440", and I need to obtain two groups of decimals...
21 May 2023 by Richard MacCutchan
The value NAN tells you that the variable(s) does not contain a valid number, and the issue is with the two lines: let V1 = parseFloat(parsedData[2]); let V2 = parseFloat(parsedData[4]); So you need to use the debugger to see what is in the...
19 May 2023 by pooran singh niranjan
Hi Team, API data response bind with checkbox column single click I need some help. I am using json with asp.net with C# What I have tried: I need some help. i am using json with asp.net with C#
15 May 2023 by vishal_h
Hi , Anyone can suggest best practice to log every request/response of Dot net core web API at single place. For example , Web API is hosted on multiple web server behind load balancer and want to check log in case of incident have to go on...
15 May 2023 by Graeme_Grant
If you're talking an ASP.Net web API server, then read this: Write custom ASP.NET Core middleware | Microsoft Learn[^].
11 May 2023 by Richard Deeming
You "solve" the CORS error by either adding the appropriate Cross-Origin Resource Sharing[^] headers to the remote site that you're trying to access, or changing your code so that it doesn't try to access resources on a different site. Trying to...
11 May 2023 by Probsol Technology 2023
The CORS error, which stands for Cross-Origin Resource Sharing, occurs when a web application running on one domain tries to access resources (such as data or files) located on another domain. This issue is primarily a security measure...
9 May 2023 by Member 11072126
Hi All, I am currently working on a project where there are many .dll files to be read from the main application. The other supportive projects are build successfully and the .dll files are also created. While running the main application, its...
28 Apr 2023 by rhl4569
i have tried to post message in teams channel by using username and password with delegated permissions. but i am getting error. i am using certificate authentication for my tenant id and client id while setting up graph api client. but how to...
28 Apr 2023 by Richard MacCutchan
Your csv handling is incorrect, as shown in the following code: foreach ($row_data as $item) { // Check if the item matches either of the user inputs if ($item == $zipcode && $item == $Housenumber) { The $item field...
28 Apr 2023 by Rebecca2002
Hey I don't really have an error for this one but if I want to check if user input is in the csv my code stops working. no errors, nothing and I don't understand why?? so this is the backend
28 Apr 2023 by OriginalGriff
Getting your code to run at all does not mean it is right! :laugh: Think of the development process as writing an email: compiling successfully means that you wrote the email in the right language - English, rather than German for example - not...
15 Apr 2023 by Graeme_Grant
I mentioned above that you should use IHttpFactory. Here is a minimal implementation (.Net 3.1+): IHttpClientFactory InitializeHttpClientFactory() { ServiceCollection builder = new(); builder.AddHttpClient(); ServiceProvider...
15 Apr 2023 by Ahmad Yousef 2021
I'm posting to web API, but it keeps loading the page without any response... What I have tried: First I tried this code after putting my url, email, key and service: public async Task Login() { using (var client...
14 Apr 2023 by Pete O'Hanlon
The two pieces of code you show are not equivalent. In the first instance, you pass the parameters as a post body. In the second instance, you add them as headers to a GET request. Which is it? Are they headers on a get or are they a post body?...
13 Apr 2023 by mtoha
try to use this functions: public async Task ConnectHttpClient(string apiUrl, R reqModel) { M model = default(M); HttpClient client = new HttpClient(); client.BaseAddress = new Uri(baseUrl); ...
11 Apr 2023 by Vasanth Chandrasekar
I want to get the id from the response when I use postman it works fine but when I try to do in vs code with php curl it shows, { "error": { "message": "(#100) The parameter messaging_product is required.", "type":...
11 Apr 2023 by Richard Deeming
Your content type header needs to be multipart/form-data, and you'll probably need to provide a boundary value: curl - Send file using multipart/form-data request in php - Stack Overflow[^]
7 Apr 2023 by RexyCode
I'm trying to code a time out "function" that can work in a nested switch and case statement. However my problem is the following, the first switch/case works like expected, on the other hand, the second switch doesn't work in any way. My...
3 Apr 2023 by Richard MacCutchan
You need to look at the actual values that are being passed in to the following lines. if not result: result[operation] = [(tuple(unique_value_freq_input), result12)] else: result[operation].append((tuple(unique_value_freq_input),...