cancel
Showing results for 
Search instead for 
Did you mean: 

REST API Error while working with SAP Cloud Platform Predictive Service

PavanKrishna
Participant
0 Kudos

Hi All,

I am working on the tutorial https://youtu.be/JxuJ5OzD8Yg (SAP HANA Academy - HCP Predictive Services: Recommendations (Trial Edition)). As mentioned in the tutorial I typed the code

{

"hanaURL": "PS_DATA/CUST_TRANSACTIONS"

}

and then hit on Post. And after hitting Post I am getting the status 400 as against Status 200.

Status 400 is an error code whose description is given in the screen shown below and the message given after the screen below:

Status 400

An error has occurred. It can be due to wrong settings or issues in the dataset.

For more information, see the list of error codes in the SAP Cloud Platform Predictive service User Guide.

Body application/json

{
	"$schema" : "http://json-schema.org/draft-03/schema#",
	"type" : "object",
	"properties" : {
		"errors" : {
			"description" : "List of error messages",
			"type" : "array",
			"items" : {
				"type" : "object",
				"properties" : {
					"errorCode" : {
						"type" : "string",
						"required" : true
					},
					"errorMessage" : {
						"type" : "string",
						"required" : true
					}
				}
			},
			"minItems" : 1,
			"required" : true
		}
	}
}

Can you please explain me how to fix this error?

Thank you.

Regards,

Pavan.

Accepted Solutions (1)

Accepted Solutions (1)

abdel_dadouche
Active Contributor
0 Kudos

Hi pavankmulpur,

My guess is that the video produced by @philip.mugglestone is simply outdated.

As per the documentation (link), you should be using the following input:

{
 "location" : {
     "schema":"PS_DATA",
     "table":"CUST_TRANSACTIONS"
    }
}

Regards

@bdel

Answers (3)

Answers (3)

PavanKrishna
Participant
0 Kudos

Hi Gentlemen,

Thanks a lot for your answers.

abdel.dadouche Yeah even I used the same code later on and it worked.

Regards,

Pavan.

thierry_brunet
Advisor
Advisor
0 Kudos

Hi,

You should have "hanaURL" with double-quote aground. This explains the error.

The videos of SAP HANA Academy have been done just after release 1.x of Predictive Services and have not been updated.

Note that in the documentation this syntax is marked as deprecated. This means that even if it continue to work, it is advised to use the new syntax.

Best regards

Thierry

PavanKrishna
Participant
0 Kudos

Hi Thierry,

I am a novice to JSON and REST API. When you say "Note that in the documentation this syntax is marked as deprecated" which documentation are you referring to? Is it the one given in the link, "https://aac4paservicesp13613784trial.hanatrial.ondemand.com/com.sap.aa.c4pa.services/raml/console/index.html?raml=../api/aa-cloud-services.raml##api_analytics_dataset_sync"

From where do I get the new syntax to be used while trying to learn watching these videos as I am now stuck at the 2nd video?

Please share any pdf or any link to the same.

Thank you.

Regards,

Pavan.

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi, maybe philip.mugglestone abdel.dadouche or thierry.brunet can help? Thanks & kind regards Antoine