Friend Request

Friend requests can be sent from/received by other Schoology users in your network.

Table of Contents

Fields

Field Name Description Type Required
requestor_id Requester ID

The user ID of the user making the request

integer
requester_name Requester Name

The display name of the user making the request

string
picture_url Picture URL

The full URL of the profile picture of the requesting user

string
school_name School Name

The school of the requesting user

string
school_id School ID

The ID of the school of the requesting user

string
created Date Created

The unix timestamp when the request was created

string

Operations

list

View a list of pending requests. You can specify the key ‘created_offset’ in the query string to view only requests that were created after the specified time. The expected format of the ‘created_offset’ key value is anything that PHP’s strtotime function can interperet. For example:

 /users/[user_id]/requests/friends?created_offset=2010-05-14+22:23:00
Path

GET https://api.schoology.com/v1/users/{user_id}/requests/friends

Content

none

Return

A collection of friend request objects, each one containing friend request fields

JSON
{
    "request": [
        {
            "id": "39095",
            "requester_id": "5",
            "created": "1389714992",
            "requester_name": "Dr. Shaw",
            "picture_url": "http:\/\/...",
            "school_name": "Washington University",
            "school_id": "170"
        }
    ]
}
XML
<?xml version="1.0" encoding="utf-8" ?>
<result>
    <request>
        <id>39095</id>
        <requester_id>5</requester_id>
        <created>1389714992</created>
        <requester_name>Dr. Shaw</requester_name>
        <picture_url>http:\/\/...</picture_url>
        <school_name>Washington University</school_name>
        <school_id>170</school_id>
    </request>
</result>

update

Update a pending request. The request action field value must be a string( accept | deny ). Here’s an example text/xml formatted request body:

Path

PUT https://api.schoology.com/v1/users/{user_id}/requests/friends/{request_id}

Content

An object containing a request_action field

JSON
{
    "request_action": "accept"
}
XML
<request>
  <request_action>accept</request_action>
</request>
Return

none