Quantcast
Viewing latest article 4
Browse Latest Browse All 4

ACS Cloud Update CustomObject Using Angular and REST

All,

I am using AngularJS with ACS as my back-end and have no problem with the Users and Events objects. I have managed to create a custom object but can't figure out for the life of me how to get it updated. My code is below:

this.updateSegment = function(segment){
        var session_id = Session.get();
        var fields = {
            'name': segment.name
        };
 
        return $http({
            method:'PUT',
                url:'https://api.cloud.appcelerator.com/v1/objects/segment/update.json?key=' + APIKey + '&_session_id=' + session_id + '&id=' + segment.id,
            data: fields
        }).then(function(response){
            self.binding.status = {'status':response.status, 'statusText':response.statusText};
            self.binding.data = response.data.response.segment;
        });
    };
If anyone can help me out I'd greatly appreciate it.

Thanks, Bruce


Viewing latest article 4
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>