Skip to main content
joelc55064357
Participant
September 10, 2018
Answered

Error Messages in Adobe Captivate API call

  • September 10, 2018
  • 1 reply
  • 1122 views

I am using Adobe Captivate Prime as Integration Admin.  I'm trying to POST to

https://captivateprime.adobe.com/primeapi/v2/users

and I keep getting the error: "{"status":"BAD_REQUEST","title":"Model path doesn't exist","source":{"info":""}}"

What does this mean?  Is there a reference for all error messages?

My angular post is:

$http({

                            url: "https://captivateprime.adobe.com/primeapi/v2/users",

                            method: "POST",

                            data: JSON.stringify(myData),

                            headers: {

                                "Accept": "application/vnd.api+json",

                                "Authorization":"oauth [my token]"

                            }

.....

and myData is a JSON object with all three required parameters listed under the attributes node.

Can anyone help?

This topic has been closed for replies.
Correct answer PRO_SOL

i have run your code in w3schools try out and i found it working.

Also i suspect your 'json post body' to be incorrect for the given api endpoint.

please look at the below code sample.

<!DOCTYPE html>

<html>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

<body>

<div ng-app="myApp" ng-controller="myCtrl">

<p>Today's welcome message is:</p>

<h1>{{myWelcome}}</h1>

</div>

<p>The $http service requests a page on the server, and the response is set as the value of the "myWelcome" variable.</p>

<script>

var app = angular.module('myApp', []);

var body = `{

  "data": {

       "type": "user",

       "attributes": {

       "email": "abc-2@xyz.com",

       "name": "abc-2",

       "userType":"INTERNAL"

      }

   }

}`;

app.controller('myCtrl', function($scope, $http) {

  $http({

    method : "POST",

    url : "https://captivateprime.adobe.com/primeapi/v2/users",

    data: body,

    headers: {

        'Authorization': 'oauth 9918beb92dd4be59b7e9c11ewq123res',

        'Accept': 'application/vnd.api+json'

    }

  }).then(function mySuccess(response) {

      $scope.myWelcome = response.data;

    }, function myError(response) {

      $scope.myWelcome = response.statusText;

  });

});

</script>

</body>

</html>

1 reply

PRO_SOLCorrect answer
Participating Frequently
September 10, 2018

i have run your code in w3schools try out and i found it working.

Also i suspect your 'json post body' to be incorrect for the given api endpoint.

please look at the below code sample.

<!DOCTYPE html>

<html>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

<body>

<div ng-app="myApp" ng-controller="myCtrl">

<p>Today's welcome message is:</p>

<h1>{{myWelcome}}</h1>

</div>

<p>The $http service requests a page on the server, and the response is set as the value of the "myWelcome" variable.</p>

<script>

var app = angular.module('myApp', []);

var body = `{

  "data": {

       "type": "user",

       "attributes": {

       "email": "abc-2@xyz.com",

       "name": "abc-2",

       "userType":"INTERNAL"

      }

   }

}`;

app.controller('myCtrl', function($scope, $http) {

  $http({

    method : "POST",

    url : "https://captivateprime.adobe.com/primeapi/v2/users",

    data: body,

    headers: {

        'Authorization': 'oauth 9918beb92dd4be59b7e9c11ewq123res',

        'Accept': 'application/vnd.api+json'

    }

  }).then(function mySuccess(response) {

      $scope.myWelcome = response.data;

    }, function myError(response) {

      $scope.myWelcome = response.statusText;

  });

});

</script>

</body>

</html>

joelc55064357
Participant
September 10, 2018

I marked it correct and it is working now.  The only change I can see is maybe that you have "type" set to "user".  But it's nice to know

you don't have to JSON strigify the JSON object, nor do you need to include all possible fields.