Re: 403 : Forbidden Operation to requested resource

Solved! Go to solution
Ranjith
Helper

403 : Forbidden Operation to requested resource

Hi Friends

 

I am trying to get started with Visa Developer. In  my project I have added "Visa Transaction Controls" API, and I can see "Alert History and Customer Profiles API" under it.

 

However when I try to access below URI (as per API specifications https://developer.visa.com/capabilities/vctc/reference#vctc__customer_rules_alerts) ,  I get error 403 in response.

 

Can you help me to understand how to proceed further?

 

 

 

 

 

2018-07-31 14:20:41 INFO  VisaAPIClient:198 - URI: https://sandbox.api.visa.com/vctc/customerrules/v1/consumertransactioncontrols/customer
2018-07-31 14:20:41 INFO  VisaAPIClient:199 - Register A Card
2018-07-31 14:20:41 INFO  VisaAPIClient:203 - RequestBody: {
  "countryCode" : "USA",
  "defaultAlertsPreferences" : [ {
    "contactType" : "Email",
    "contactValue" : "ranjith@abc.com",
    "isVerified" : true,
    "status" : "Active"
  } ],
  "firstName" : "Ranjith",
  "lastName" : "Test",
  "preferredLanguage" : "en-us",
  "userIdentifier" : "CIF001",
  "primaryAccountNumber" : "4514170000000001"
}
2018-07-31 14:20:43 INFO  VisaAPIClient:171 - Response status : HTTP/1.1 403 Forbidden

2018-07-31 14:20:43 INFO  VisaAPIClient:173 - Response Headers:

2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Server:Apache
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-SERVED-BY:l55c002
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-CORRELATION-ID:1533018044_958_78_l55c002_VDP_ARM
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-Backside-Transport:FAIL FAIL,FAIL FAIL
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-OPNET-Transaction-Trace:a2_f79bb85f-81a4-4faf-8db1-1b7de29841fe
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Strict-Transport-Security:max-age=31536000; includeSubDomains ,max-age=2592000;includeSubdomains
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Cache-Control:no-cache, no-store, must-revalidate
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Pragma:no-cache
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Expires:-1
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-Global-Transaction-ID:636717573
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-APP-STATUS:403
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-Frame-Options:SAMEORIGIN
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-XSS-Protection:1; mode=block
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - X-Content-Type-Options:nosniff
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Content-Type:application/json;charset=UTF-8
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Content-Language:en-US
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Content-Length:103
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Date:Tue, 31 Jul 2018 06:20:45 GMT
2018-07-31 14:20:43 INFO  VisaAPIClient:176 - Connection:close
2018-07-31 14:20:43 INFO  VisaAPIClient:177 -
 Response Body:
2018-07-31 14:20:43 INFO  VisaAPIClient:184 - ResponseBody: {
  "metainfo" : {
    "Description" : "Forbidden",
    "Code" : 403
  },
  "error" : "Forbidden Operation to requested resource"
}
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.098 sec <<< FAILURE!
testRegisterACard(com.visa.vdp.vctc.TestAlert)  Time elapsed: 3.132 sec  <<< FAILURE!
java.lang.AssertionError: expected [true] but found [false]
        at org.testng.Assert.fail(Assert.java:94)
        at org.testng.Assert.failNotEquals(Assert.java:513)
        at org.testng.Assert.assertTrue(Assert.java:42)
        at org.testng.Assert.assertTrue(Assert.java:52)
        at com.visa.vdp.vctc.TestAlert.testRegisterACard(TestAlert.java:52)


Results :

Failed tests:   testRegisterACard(com.visa.vdp.vctc.TestAlert): expected [true] but found [false]

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

6 REPLIES 6
vkamboj
Community Moderator

Re: 403 : Forbidden Operation to requested resource

Hello @Ranjith

 

I am working on your inquiry, I will get back to you soon. 

 

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.
vkamboj
Community Moderator

Re: 403 : Forbidden Operation to requested resource

Hi @Ranjith

 

Have you registered the card before trying to add the Customer Alerts Profile ?  

 

Kindly register the card using the below API and try again.

https://developer.visa.com/capabilities/vctc/reference#vctc__customer_rules__v1__vtc_registration

 

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.
Ranjith
Helper

Re: 403 : Forbidden Operation to requested resource

Thank you Vaibhav

 

 

Registering the card, resolved this issue. Thanks a lot

 

 

Ranjith
Helper

Re: 403 : Forbidden Operation to requested resource


Apparently, the issue seems to be because of the test data. (improper card number)

When I tried "primaryAccountNumber": "4514170000000001", I get 403 "error" : "Forbidden Operation to requested resource"

However when I tried "primaryAccountNumber" : "4965152911511236", I get 422 "error" : [ "Unable to process due to invalid data." ]

When I tried "primaryAccountNumber" : "4865152911511237", Its success (even if i had not done the card registration)

Is there is any documentation on test data usage for card number?
vkamboj
Community Moderator

Re: 403 : Forbidden Operation to requested resource

Hi @Ranjith

 

Out of the below card numbers which card numbers are from the TEST data tab ? Can you please let us know so we can debug further on the cards that are part of TEST data tab and are failing for you ?

 

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.
Ranjith
Helper

Re: 403 : Forbidden Operation to requested resource

Hi Vaibhav,

 

The test data tab shows "486515291151XXXX" and any number starting in "486515291151" is working for me.

 

The error was when I tested using other numbers that are not conforming to test data.

 

For now I dont have an issue, as I am testing using proper test data.

 

Thanks for your support.