| Required permission: | ReadInstitutions |
| POST | /institutions |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class InstitutionResponse implements IConvertible
{
ResponseStatus? responseStatus;
int? institution_id;
String? institution_name;
String? institution_previous_names;
String? institution_other_names;
String? institution_type;
String? accreditation_status;
String? accreditation_status_notes;
List<String>? related_institutions;
DateTime? accreditation_status_changed_date;
String? gpa_conversion;
String? credit_hour_conversion;
String? addr1;
String? addr2;
String? city;
String? state;
String? country;
String? zip;
InstitutionResponse({this.responseStatus,this.institution_id,this.institution_name,this.institution_previous_names,this.institution_other_names,this.institution_type,this.accreditation_status,this.accreditation_status_notes,this.related_institutions,this.accreditation_status_changed_date,this.gpa_conversion,this.credit_hour_conversion,this.addr1,this.addr2,this.city,this.state,this.country,this.zip});
InstitutionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
institution_id = json['institution_id'];
institution_name = json['institution_name'];
institution_previous_names = json['institution_previous_names'];
institution_other_names = json['institution_other_names'];
institution_type = json['institution_type'];
accreditation_status = json['accreditation_status'];
accreditation_status_notes = json['accreditation_status_notes'];
related_institutions = JsonConverters.fromJson(json['related_institutions'],'List<String>',context!);
accreditation_status_changed_date = JsonConverters.fromJson(json['accreditation_status_changed_date'],'DateTime',context!);
gpa_conversion = json['gpa_conversion'];
credit_hour_conversion = json['credit_hour_conversion'];
addr1 = json['addr1'];
addr2 = json['addr2'];
city = json['city'];
state = json['state'];
country = json['country'];
zip = json['zip'];
return this;
}
Map<String, dynamic> toJson() => {
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'institution_id': institution_id,
'institution_name': institution_name,
'institution_previous_names': institution_previous_names,
'institution_other_names': institution_other_names,
'institution_type': institution_type,
'accreditation_status': accreditation_status,
'accreditation_status_notes': accreditation_status_notes,
'related_institutions': JsonConverters.toJson(related_institutions,'List<String>',context!),
'accreditation_status_changed_date': JsonConverters.toJson(accreditation_status_changed_date,'DateTime',context!),
'gpa_conversion': gpa_conversion,
'credit_hour_conversion': credit_hour_conversion,
'addr1': addr1,
'addr2': addr2,
'city': city,
'state': state,
'country': country,
'zip': zip
};
getTypeName() => "InstitutionResponse";
TypeContext? context = _ctx;
}
class InstitutionRequest implements IConvertible
{
int? institution_id;
InstitutionRequest({this.institution_id});
InstitutionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
institution_id = json['institution_id'];
return this;
}
Map<String, dynamic> toJson() => {
'institution_id': institution_id
};
getTypeName() => "InstitutionRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'InstitutionResponse': TypeInfo(TypeOf.Class, create:() => InstitutionResponse()),
'InstitutionRequest': TypeInfo(TypeOf.Class, create:() => InstitutionRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /institutions HTTP/1.1
Host: data.regent-college.edu
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<InstitutionRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Requests">
<institution_id>0</institution_id>
</InstitutionRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<InstitutionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/regis.ClassLibrary.Responses">
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<accreditation_status>String</accreditation_status>
<accreditation_status_changed_date>0001-01-01T00:00:00</accreditation_status_changed_date>
<accreditation_status_notes>String</accreditation_status_notes>
<addr1>String</addr1>
<addr2>String</addr2>
<city>String</city>
<country>String</country>
<credit_hour_conversion>String</credit_hour_conversion>
<gpa_conversion>String</gpa_conversion>
<institution_id>0</institution_id>
<institution_name>String</institution_name>
<institution_other_names>String</institution_other_names>
<institution_previous_names>String</institution_previous_names>
<institution_type>String</institution_type>
<related_institutions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</related_institutions>
<state>String</state>
<zip>String</zip>
</InstitutionResponse>