Re: 404 NotFound while accessing Apis

ezamarichard
Regular Contributor

404 NotFound while accessing Apis

it looks like am now able to generate the right x-pay-token

Here comes Mr 404

error even when the url returns a response over the browser

av gone through a couple of other forums and it looks like

and X correlation id

 

Kindly advise Me

Thanks as Usual

5 REPLIES 5
vkamboj
Community Moderator

Re: 404 NotFound while accessing Apis

Hi @ezamarichard

 

I see that you have posted couple other inquiries for 404 error you have received. Please provide the information on this post - https://community.developer.visa.com/t5/Getting-Started-with-Visa/Success-With-Non-x-pay-token-Api-c...

 

Thank you, 

Vaibhav 

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
elvisfernandes
Dabbler

Re: 404 NotFound while accessing Apis

hello,
You have to create a REST resource at /api/banks/1 first; otherwise you'll get a 404, since the resource does not exist.

You can programmatically create a REST resource and pre-load it when your server starts, like this:

var swaggerServer = require('swagger-server');
var app = swaggerServer('banks-api.json');

// Create Bank #1
var myBank = new swaggerServer.Resource('/api/banks', 1, {BankId: 1, Name: 'My Bank'});
app.dataStore.save(myBank);

// Start listening on port 8000
app.listen(8000, function() { ... }
Or you can add a POST operation to your /api/banks path, or a PUT operation to your /api/banks/{bankId} path. Then use a tool like Postman to add banks at runtime.

"paths": {
"/api/banks": {
"post": {
"description": "Create a new bank",
"consumes": ["application/json"],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/BankViewModel"
}
}
],
"responses": {
"201": {
"description": "Bank created successfully",
"headers": {
"Location": {
"type": "string"
}
}
}
}
},

 

vkamboj
Community Moderator

Re: 404 NotFound while accessing Apis

Hi @elvisfernandes

 

Can you please let me know the endpoint you re trying to access? If you are getting an error possibly x-correlation-id from the response header. 

 

Thank you, 

Vaibhav 

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
andrepooran24
Newbie

Re: 404 NotFound while accessing Apis


@elvisfernandes wrote:

hello,
You have to create a REST resource at /api/banks/1 first; otherwise you'll get a 404, since the resource does not exist.

You can programmatically create a REST resource and pre-load it when your server starts, like this:

var swaggerServer = require('swagger-server');
var app = swaggerServer('banks-api.json');

// Create Bank #1
var myBank = new swaggerServer.Resource('/api/banks', 1, {BankId: 1, Name: 'My Bank'});
app.dataStore.save(myBank);

// Start listening on port 8000
app.listen(8000, function() { ... }
Or you can add a POST operation to your /api/banks path, or a PUT operation to your /api/banks/{bankId} path. Then use a tool like Postman to add banks at runtime.

"paths": {
"/api/banks": {
"post": {
"description": "Create a new bank",
"consumes": ["application/json"],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/BankViewModel"
}
}
],
"responses": {
"201": {
"description": "Bank created successfully",
"headers": {
"Location": {
"type": "string"
}
}
}
}
},

Download Bluestacks Download TextNow  Download Photomath


I have tried this one but, it's not working please help to find out a solution for this.

raymondred
Dabbler

Re: 404 NotFound while accessing Apis

Strut worker will create and restore ridiculed substances without anyone else dependent on gave strut spec. records must be made by means of API or automatically.