POST api/StudentPeerRequest/Post

Creates a student request for on-demand resource. If there is an existing session that matches the request, creates a group session and returns 201-Created along with the session DTO. Otherwise, notifies tutors and returns 200-Ok along with the request DTO. If the call fails, it returns 400-BadRequest along with the reason of failure.

Request Information

URI Parameters

None.

Body Parameters

PostPeerRequestDto
NameDescriptionTypeAdditional information
CourseId

integer

Required

TimeRequested

integer

Required

Range: inclusive between 900000 and 14400000

Schedule

Collection of IntervalDto

Required

Request Formats

application/json, text/json

Sample:
{
  "CourseId": 1,
  "TimeRequested": 2,
  "Schedule": [
    {
      "Start": 1,
      "End": 2
    },
    {
      "Start": 1,
      "End": 2
    }
  ]
}

application/xml, text/xml

Sample:
<PostPeerRequestDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/StudyTree.Core.Dtos">
  <CourseId>1</CourseId>
  <Schedule xmlns:d2p1="http://schemas.datacontract.org/2004/07/StudyTree.Core.Dtos.PersonNs.ScheduleNs">
    <d2p1:IntervalDto>
      <d2p1:End>2</d2p1:End>
      <d2p1:Start>1</d2p1:Start>
    </d2p1:IntervalDto>
    <d2p1:IntervalDto>
      <d2p1:End>2</d2p1:End>
      <d2p1:Start>1</d2p1:Start>
    </d2p1:IntervalDto>
  </Schedule>
  <TimeRequested>2</TimeRequested>
</PostPeerRequestDto>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

HttpResponseMessage
NameDescriptionTypeAdditional information
Version

Version

None.

Content

HttpContent

None.

StatusCode

HttpStatusCode

None.

ReasonPhrase

string

None.

Headers

Collection of Object

None.

RequestMessage

HttpRequestMessage

None.

IsSuccessStatusCode

boolean

None.