POST api/Student/UploadStudentPhoto

This API uploads a student's photo to the ERP server. It accepts Base64 image data, generates the photo filename based on session and reg. number, sends the image to ERP's Upload Controller, updates the database, and returns a ResultModel response.

Request Information

URI Parameters

None.

Body Parameters

Contains SessionId, RegNo, StuId, and Base64 image string.

StudentPhotoUploadRequest
NameDescriptionTypeAdditional information
SessionId

integer

None.

RegNo

string

None.

stuId

integer

None.

PhotoBase64

string

None.

Request Formats

application/json, text/json

Sample:
{
  "SessionId": 1,
  "RegNo": "sample string 2",
  "stuId": 3,
  "PhotoBase64": "sample string 4"
}

text/html

Sample:
{"SessionId":1,"RegNo":"sample string 2","stuId":3,"PhotoBase64":"sample string 4"}

application/xml, text/xml

Sample:
<StudentPhotoUploadRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/smsapi.Models">
  <PhotoBase64>sample string 4</PhotoBase64>
  <RegNo>sample string 2</RegNo>
  <SessionId>1</SessionId>
  <stuId>3</stuId>
</StudentPhotoUploadRequest>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

ResultModel: resultcode = 0 (success), 1 (error), 2 (not applicable here)

IHttpActionResult

None.

Response Formats

application/json, text/json, text/html, application/xml, text/xml

Sample:

Sample not available.