Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

The response from a web service request will change depending on the type of request sent. Some responses contain an array of information, others only HTTP Status codes.

Read (GET)

Read, or GET requests, return an array of information, including any records found to match the given criteria. The response array is structured to handle paginated requests, and includes a 'list' of the records on the current page. The examples below show requests for user enrollment information, with responses where a user, uid 200, is enrolled in one course, nid 310, but not enrolled in another, nid 300.

Definitions

self: The current page being viewed

first: The first page in the data set

last: The last page in the data set. If this matches the value in first, the data set has been returned in full in the list option.

list: The data set page range found in the current self request

Example Returns

Response With Enrollment
stdClass Object
(
    [self] => http://your-domain.com/course_enrollment?uid=200&nid=310 // The current page the list value displaying information
    [first] => http://your-domain.com/course_enrollment?uid=200&nid=310&page=0
    [last] => http://your-domain.com/course_enrollment?uid=200&nid=310&page=0
    [list] => Array
        (
            [0] => stdClass Object
                (
                    [eid] => 185
                    [nid] => stdClass Object
                        (
                            [uri] => http://your-domain.com/node/310
                            [id] => 310
                            [resource] => node
                            [uuid] => 9aabcf09-58c3-4679-85b3-c5f7ddc93ac6
                        )

                    [uid] => stdClass Object
                        (
                            [uri] => http://your-domain.com/user/200
                            [id] => 200
                            [resource] => user
                            [uuid] => ba5bc8af-25d7-48de-bb54-87ae70ac33b5
                        )

                    [enrollmenttype] => 
                    [status] => 1
                    [created] => 1459800985
                    [timestamp] => 1459800985
                    [enroll_end] => 0
                    [code] => 
                    [user_type] => 
                    [data] => 
                    [feed_nid] => 
                )
        )
)
Response Without Enrollment
stdClass Object
(
    [self] => http://your-domain.com/course_enrollment?uid=200&nid=300 // The current page the list value displaying information
    [first] => http://your-domain.com/course_enrollment?uid=200&nid=300&page=0
    [last] => http://your-domain.com/course_enrollment?uid=200&nid=300&page=0
    [list] => [] 
)

Create (POST)

Update (POST)

Delete (DELETE)

  • No labels