Questions tagged [api]

Please refrain from using this phrase. Instead, utilize specific tags such as [google-cloud-platform], [facebook], or [amazon-web-services]. When appropriate, include the tag [api-design]. Queries seeking recommendations or assistance in locating an API are considered inappropriate for discussion on this platform.

Show the current temperature data retrieved from the weather API

I'm trying to figure out what's causing the issue with the temperature not displaying. Can anyone help me identify and fix the error? <script type="text/javascript"> $.ajax({ url: 'https://api.weather.gov/gridpoints/EWX ...

Receiving HTML from NodeJs instead of JSON

I am currently working on a project that involves developing an app and landing pages. While we are using NodeJs with Axios and VueJs for the app part, the landing pages are built using simple jQuery. I need to make API calls for the landing pages, but I a ...

What could be causing the error message "Error: Cannot modify headers after they are sent" to appear?

I am attempting to insert data into an MS SQL server when a JSON Data API POST request is made. var express = require('express'); var app = express(); var sql = require('mssql'); // Connection string parameters. var sqlConfig = { user: 'sa', passw ...

Develop an efficient file uploading API in PHP that is constantly updating and adapting

I have been working on developing a file upload API in PHP. Currently, I have created a simple PHP script that enables the uploading of files from an HTML page to a server. However, the code I have written has a fixed name for the file upload control, whic ...

Creating numerous pre-signed URLs using an Application Programming Interface

An API has been developed to generate pre-signed URLs for files stored in a private S3 bucket. The goal is to store these URLs in an array for access from another application. ["FILE1 pre-signed URL", "FILE2 pre-signed URL", etc..] However, there seems to ...

Ways to prevent API requests from being repeatedly made within a specified time frame

Currently, I am utilizing Rest API in conjunction with node js. My specific requirement involves the need to implement a blocking mechanism for repeated requests received within a defined time frame of 15 minutes (as tokens expire after this period). The ...

Struggling to update state data with response data in React, despite the response not being empty

I'm currently working on my first React API application and I am facing an issue where the state data appears to be empty even after assigning res.data, which is not empty. Additionally, I am struggling with rendering all of this content inside a div. Whe ...

What is the process for determining the area code of a location based on the postal code/zipcode?

Currently, I am in the process of developing an app's payment system that requires me to incorporate Canadian GST and HST taxes based on the customer's zipcode. This is necessary because my shipping method calculates shipping charges using the provided zip ...

Instructions on how to insert a hyperlink into the information within the generated div utilizing an API

Currently, I am fetching information from an API based on the user's input (zipcode). The data retrieved includes the name of the institution, address, and webpage. I've been trying to make the webpage link clickable by adding a hyperlink to the ...

"Conducting API calls in NextJS: Why is Axios/Fetch returning incorrect results when using the post

I'm trying to use a post method on an API, but for some reason when I call the function it posts to the wrong path of the API. Here is the script I am using for the post: //Creating Order const createOrder = async (data) => { try { co ...

The CORS policy has blocked the 'Access-Control-Allow-Origin' header

My expertise lies in creating API, BackEnd, and Frontend websites. For the API, I utilize Express, while for the BackEnd - FrontEnd, I rely on ReactJs. During local testing, everything functions as expected. However, upon deployment to the server, error ...

Passing multiple parameters in URL for APIs using Next.js

Is there a way to pass multiple parameters and retrieve results from the next.js API? I found the documentation very helpful, you can check it out here /api/posts/[postId].js The above setup works fine, but I want to know if it's possible to pass another ...

Is there a way to load information retrieved from an API into a dropdown menu in Laravel with the help of VueJS and axios?

After many attempts, I still can't seem to fetch my API data into a select list successfully. Everything seems to be retrieved properly, but when it comes to displaying them, nothing shows up. Could there be an issue with my code? Here's my routes/web.php ...

Is there a method to retrieve the email address after obtaining the authentication token in Keystone?

Hey there! I was wondering if anyone knows if it's possible to retrieve a user's email address using the REST API v2.0 provided by Keystone for authentication in my application. I have been looking through the API docs and noticed that you can get user det ...

Error: JSON data couldn't be processed due to an unexpected end, resulting in a SyntaxError at JSON.parse()

I'm currently working on making an ajax call to an API, but I keep encountering an error whenever I try to make the call. I've been troubleshooting this for hours and I can't seem to figure out what the issue is. At one point, I even removed the JSON.pars ...

Transferring information in JSON format from an API to a JavaScript variable

Hi there, I'm new to json/javascript so your patience is appreciated. I am receiving json data from an API URL that looks like this: { "employees": [ { "firstName":"John" , "lastName":"Doe" }, { "firstName":"Anna" , "lastName":"Smith" }, { "firstName": ...

Unlocking the power of JSON deserialization for child objects in ASP.NET Core

Looking to deserialize a JSON API response and needing guidance on accessing properties of a nested object. Here is an example of the API response I am trying to work with: { "token_type": "Bearer", "expires_at": 1598830199, "expires_in": ...

Using Vue.js to integrate and interact with a RESTful API

Using Vue solely through CDN is my preference as I am not very comfortable with the command line interface. Is it feasible to integrate the Vue.js CDN for implementing login authentication on my frontend website by fetching API data from my RESTful API? ...

Is it possible to replace or update the CONSUMER_KEY and CONSUMER_SECRET values in any way?

Currently, I am utilizing Laravel along with the thujohn/twitter package. My goal is to have users provide their own CONSUMER_KEY and CONSUMER_SECRET upon registration. This information will be used for posting tweets, favoriting tweets, etc. The issue is ...

Is there a way to make Express.js pass parameters with special characters exactly as they are?

I am currently working on a project within the freeCodeCamp "API and Microservices" curriculum that involves using Express.js to handle routes. The project itself is relatively straightforward, with some pre-defined routes and others that need to be creat ...

Set up a new account using a RESTful API

Looking to establish a secure API using node.js for my mobile application. The goal is for users to sign up through the app with their email and password. I'm contemplating the best approach, which ideally looks something like: curl -d '{"email" ...

Ways to exhibit API information leveraging the prowess of Ajax

I am looking for a way to utilize the API in order to present data in an organized manner, similar to the following example: Job Title: Agricultural and Related Trades Percentage of Occupancies in Area: 15.41% Unfortunately, my attempt to showcase the d ...

How can I retrieve JSON data from within a function and show it on a textfield in Swift programming language?

I've been exploring how to parse JSON data into Swift, specifically attempting to display the area of my pincode in a text field. In order to do this, I've created three Swift files: mapview.swift, maphandler.swift, and mapmodel.swift. The issue I'm facing ...

Setting up an angular2 web application on an Nginx server and forwarding HTTP requests to the backend API for

Seeking assistance with setting up angular2 routes and proxying http requests to a rest api on a separate server Currently, I have an angular2 web application running on an nginx server which serves the static html files. The rest api that the application ...

Using Python to iterate through various pages on an API and extracting specific data before printing it

Hey there! I'm new to programming and practicing my skills. I've been exploring the Star Wars API, which contains data on characters, films, planets, and more from the Star Wars universe. Right now, I'm working on looping through all the pages of the API t ...

Tips on locating information within a pre-existing GET array with parameters provided

Apologies for the unclear title. I am currently utilizing a category chooser that pulls categories from an API. The process involves fetching a list of categories, filtering out their names, and presenting them in the category chooser. Upon clicking submit ...

The error message "TypeError: list indices must be integers or slices, not str" occurs when trying to access list elements

I am encountering an issue while attempting to retrieve data from the API. Specifically, I am looking to obtain the block height from this particular API. import requests import json fetch_json_data = requests.get('https://api.minaexplorer.com/blocks?l ...

Dealing with null JSON objects in ReactJS

When fetching data from the backend using an API, I need to verify if a domain is valid. The challenge arises when the domain is not valid (i.e. it does not exist in the backend), resulting in an empty array [] being returned. To handle this situation, I ...

Optimal method for updating language-specific content received from APIs

Scenario: In my Vuejs SPA, I have successfully implemented localization on both frontend and backend. The content updates seamlessly without needing to reload the page when switching languages. Issue: However, certain contents l ...

The PDF file appeared blank after receiving a response from the API using Node.js

When I call a REST API that returns a PDF file, the document appears blank when opened. The console indicates that the data may be corrupted. let url ="API-URL"; var options = { 'method': 'GET', 'url': url, 'id': '50d55684-9c61-484 ...

Cancelling a lengthy external API request within a Vercel serverless function

My Vercel serverless function includes a request to an external API using node fetch. To prevent it from running for too long, I am planning to set a timeout of one second for aborting the external request if it exceeds this threshold. Do you think this i ...

Encountered an error when attempting to load resource: net::ERR_CERT_AUTHORITY_INVALID following deployment on Vercel

I recently deployed a chatUI-app on Vercel that fetches chats from an API located at "http://3.111.128.67/assignment/chat?page=0" While the app worked perfectly in development, I encountered an issue after deploying it on Vercel where it ...

Make sure to refresh the node.js express api every minute with the latest timestamp available

I'm currently working on setting up a Node.js Express API to expose a MySQL table. Everything is working fine except for the part where I need to filter data by a current timestamp and update it every few minutes. I've tried using setInterval but ...

Difficulty encountered while transmitting the JSON object to third-party API

Initially, the API structure is beyond my control and all I can do is make a simple call to it. Here are the required parameters to pass in: { "ConsumerAggregatedAttributes": [ { "ConsumerAggregatedAttribut ...

Navigating through elements in Angular

I am working with multiple Angular components housed within a display:flex div container. I am fetching datatable from an API, and it contains the same number of rows as there are components. Each row in the datatable corresponds to data for each compone ...

How can I ensure that the results retrieved from the Pocket API JSON are always in a single row? Let's find a solution

I have been attempting for hours and conducting a thorough search to extract a dataframe from the list retrieved from my Pocket API. However, my code is aggregating everything into a single row, which is not the desired outcome. I have made numerous atte ...

Transmit data to a modal popup in Angular 8

Here is the code snippet written in .ts file: openFormModal(id: number) { console.log(id); const modalRef = this.modalService.open(PartidoComponent); modalRef.componentInstance.id = id; //modalRef.componentInstance.id = id; modalRef.r ...

Transmit: Forwarding information back to the recipient

My goal is to send an Http Post request (Registration form) using Angular, have it processed in the API, and if any errors occur like Please enter a username..., I want to return an error message to the client. Below is the Angular code for reference. Than ...

``What is the best way to set up the Vue app based on the initial back-end response?

I'm in need of a way to run some code before any other functionality in my app is executed. This code needs to send a request to the back-end and update the store first, as route guards depend on it. How can I achieve this? Code Example Fetching user info ...

Transfer files seamlessly between different APIs

Is it possible to directly transfer thousands of files (images, pdfs) from one third-party API service to Google Drive API without the need for intermediate storage like an AWS S3 bucket? I already have authentication set up for both APIs. I am considerin ...

Mastering APIs and Harnessing their Power

I am currently working on a project involving React and Express. In the backend, I have created a small API that streams information on my /API/ routes in the form of a JSON object. However, I am unsure how to display this information on the front end an ...

Using the Twit package on the client side: a step-by-step guide

I have been utilizing the Twit package for searching tweets. After executing the js file in the console, I am able to see the tweets but when trying to use them on my webpage, an error 'Uncaught ReferenceError: require is not defined' pops up. The reason f ...

Website API: decouple backend and frontend functionality through an API

I am currently working on the development of a website and an app created through Cordova. The app will essentially mirror the functionalities of the website. The website is already established and heavily relies on JavaScript, with potential considerati ...

Axios GET request encounters Error 401 - Access Denied

In my current ReactJS project, I am utilizing axios to fetch data from MongoDB. Within this project, I have a login component that invokes a startLogin function. This function includes two axios requests: one POST request to send user data and another GET ...

Encountering authentication issues with REST API in React

I'm currently working on a project that involves using Laravel 9 for the backend and React for the frontend. Whenever I attempt to make a request, it returns an unauthorized error from the backend. However, when I test this in Postman, it returns a su ...

Generate an object in Google Cloud Storage using the Text to Speech Response feature in Adalo

I'm currently developing an application using Adalo and have successfully created a custom action that generates a Text to Speech file. The API response includes "audioContent", which I now want to use in another API call to create a new object in Google C ...

Using Fetch API in NextJS requires pressing the Enter key twice for it to work properly

The functionality of this component should display JSON data in the console log after entering input into the search bar and hitting the enter key. However, there is a lag where the data doesn't show until the enter key is pressed a second time. Additional ...

Python - Retrieve data from a dataframe (JSON)

After taking a break from coding for some time, I am now diving back in as a beginner. I am currently using the requests library to fetch JSON data from the Incapsula API in order to collect stats about website traffic. My goal is to extract and write the ...

Guide on sending the API key to an API gateway through a request header with Jquery AJAX

I am facing an issue posting JSON data to an AWS API gateway that is protected by an API key. I managed to make the POST request successfully using Postman by adding the x-api-key header. However, I am struggling to achieve the same with JQuery code. How c ...

Guide to implementing scheduled tasks in a Node.js API using Express

Currently, my Node API has multiple endpoints, and while they work well for the most part, there is one endpoint that struggles with processing large requests taking up to 1 hour. To handle this, I am considering implementing a system where instead of wait ...

What is the best way to convert API data into a currency format?

Hello, I need assistance with formatting data retrieved from an API into a currency format. The code below successfully retrieves the data but lacks formatting. For instance, if the data displays as 100000000, I would like it to be formatted as IDR100.000. ...

Power Query M - Tackling Expression Error in Transforming Lists to Text

In my code, I'm using Web.Contents to make an API request. The access token I pass as a parameter is dynamically generated by a separate function. let Source = Json.Document( Web.Contents( {"https://api-url.com/endpoint/id"}, ...

I am encountering an issue where the POST request from the frontend to the backend is not returning the desired

Currently, I am working on a project that involves using a React frontend and an Express backend. While I am able to successfully make GET requests to retrieve data from the backend without any issues, I am facing difficulties in making POST requests and a ...

Exploring AngularJS Protractor End-to-End Mocking

In my Angular SPA, I am retrieving data from a node backend that is fully covered with tests. To mock the Angular HTTP calls, I want to implement something like this: Api = $injector.get('Api'); sinon.mock(Api, 'getSomethingFromServer' ...

What is the best way to remove uncategorized posts from WordPress for good?

In my WordPress site, I am attempting to delete the uncategorized category permanently. After doing some research, it seems like there may not be a straightforward solution for this issue. However, in my vue.js project where I am utilizing the wp api and ...

Tips for isolating the month values from the res.body.results array of objects with the help of JS Array map()

Looking to adjust the custom code that I have which aims to extract months from a string using regex. It seems like I'm almost there but not quite hitting the mark. When checking the console log, I am getting "undefined" values for key/value pairs and ...

Sending a post request to a Spring controller with ajax: Step-by-step guide

I am having trouble sending a post request to the spring controller using ajax. It seems that something is not working correctly. If anyone can help me figure out what I did wrong, I would greatly appreciate it. $("#myprofile").on('submit&ap ...

Getting both the data by name and its corresponding ID in an Express route parameter using Mongoose

Locating data using ID as a route parameter can be done like this The URL would look something like: http://localhost:8000/products/60d1789867bc6624403ade6e // Fetching a single product router.get("/:id", async (req, res, next) => { const id = req.para ...

Postman's GET Request is stuck and fails to provide any results

I've been working on creating a REST API using Node.js, Express, & MongoDB. So far, everything seems to be functioning properly. The server is up and running, and it successfully connects to the MongoDB database named API, which consists of two collections ...

What is the most efficient approach to completing everyday tasks directly in a Vuex store?

Currently, I am working on making API calls from within a Vuex store action object. Here's an example of one of my actions: /** * Check an account activation token * */ [CHECK_ACTIVATION_TOKEN] ({commit}, payload) { Api.checkActivationToken(payl ...

Is there a method to verify the consumability of an API without having to make a direct request to it?

I'm working on an idle timer feature where the API will be called to update data once the timer runs out. How can I check if the API is still usable without actually sending a request? ...

What is the process for attaching a component to a new Ticket using the Jira Rest API during its initial creation?

Every time I attempt to link a component to a ticket while in the creation stage, it fails to properly assign the component. The ticket ends up being created without the component associated with it. Here is how I tried to do it: "components": [ ...

Why isn't my API's JSON Response showing up in PHP?

Having trouble displaying the JSON response from an API call in PHP. Despite confirming that the server, IP settings, and API status are all fine on the provider's end, I am unable to identify the problem. This is how I'm handling the PHP part: PHP $u ...

Encountering Issue in NodeJS+Express : 'Failed to retrieve /...'

I have been developing an API for restaurants and have created the corresponding controller and model as detailed below. Controller (restaurantData.js) const restaurantData = require('../Models/restaurantData'); exports.getRestaurantData = (req, res) =&g ...

Having trouble uploading SharePoint list item with attachment from Angular to ASP.NET Core Web API via NgModel

Recently, I successfully added a SharePoint list item with an attachment from Angular to ASP.NET Core Web API. This was achieved using FormControl in the Angular application. I found guidance on how to upload files from Angular to ASP.NET Core Web API at ...

Show a distinct row from an API using React

I am attempting to create a map function to display all the items from the API Screenshot of code showing the items Here is the console log displaying the fetched items from the API I encountered an error with the map function not working. Any solutions ...

Is your Telegram Bot experiencing issues with executing queries (such as sendMessage and deleteMessage) simultaneously?

Is it possible to simultaneously perform the sendMessage and deleteMessage functionalities using the Telegram Bot API? I have been trying to execute both methods at the same time but it seems like only one of them works. Is there a way to make both work t ...

What are the steps to implement background synchronization in place of making fetch requests upon UI changes?

Consider this scenario: A straightforward web application with a comments feature. In my view, when a user submits a comment, the following steps would typically unfold: Show UI loader; Update the front-end state; Send a fetch request to the API to post ...

I am consistently encountering errors with the PayPal PHP Adaptive Payment API, specifically receiving the message, "Sorry, we can't complete your payment at this time."

I tested some sample files with the latest PHP API for adaptive payment (1.96) and successfully created a primary payment using my sandbox account. Everything worked fine. I then integrated the API into my PHP application. After creating a primary payment ...

Sharing an update on my wall

Looking for a way to customize wall posts on my Facebook Application Profile Page, as the existing "Post to Wall" functionality doesn't post the pictures I want. I'm in need of a PHP script that can help me achieve this: Inputs: App ID (ID ...

What is the best way to send multiple API requests and save the data to a JSON file?

In my Python script, I am attempting to make multiple API calls using the requests library. Currently, my code involves connecting to different API URLs and writing the JSON responses to separate files for further data manipulation. The connection and writ ...

Using Axios to Integrate an API - Displaying a Username and Password Pop-up

I have been given a project that involves API integration. I have successfully retrieved data from the API, but there is a pop-up appearing asking for a username and password. Although I have these credentials, I would like to log in without that pop-up ap ...

Sending numerous files from a Google Cloud virtual machine to Google Cloud Storage through node.js and a library called Glob

Exploring the use of Node.js for uploading multiple files from my Google Compute Engine VM local directory to a pre-existing GCS bucket has hit a snag. With each script execution, I encounter the following error message: TypeError [ERR_INVALID_ARG_TYPE]: ...

Implementing a user-friendly unsubscribe feature for your subscribers using the SendGrid Node.js API

Currently, I am implementing Sendgrid for sending emails to subscribers. The function used for email sending is as follows, leveraging the nodejs API (detailed documentation can be found here: https://github.com/sendgrid/sendgrid-nodejs): var email = new ...

Looking to showcase initial API data upon page load without requiring any user input?

Introduction Currently, I am retrieving data from the openweatherAPI, which is being displayed in both the console and on the page. Issue My problem lies in not being able to showcase the default data on the frontend immediately upon the page's fir ...