NAV
REST/HTTP C# cURL

Introduction

Welcome to the GIFTS Online API!

Getting Started

The GIFTS Online API documentation is available to the public. However, access to the API is limited.

Contact your account representitive for more information.

.NET SDK

A .NET SDK is available at NuGet.org to simplify development for .NET projects making calls to the GIFTS Online API. This tutorial from Microsoft shows how to install a NuGet package in Visual Studio. Click the C# tab to the right to see example code throughout this documentation.

Example project

For an example of how to write code that interacts with the GIFTS Online API, refer to the Javascript Sample Application. You may use this code as a base for an application to suit your needs.

Limitations

Calls from any given client key to the API are limited to 20 calls per second and 10,000 calls per 24 hours. Any calls beyond this limit will be rejected.

Authentication

POST https://api.microedge.com/auth/token/me-auth HTTP/1.1

Request payload should be a JSON object containing your User ID and Private Key:

{
    userId: <userid>,
    privateKey: <privatekey>
}
string key = <userid>;
string secret = <privatekey>;
var client = new OrganizationClient(key, secret);
curl -v -X POST "https://api.microedge.com/auth/token/me-auth" ^
-H "Content-Type: application/json" ^
--data-ascii "{'userId':'<userid>','privateKey':'<privatekey>'}"

In response to your request for credentials, you will be given a User ID and Private Key which will be used to perform authentication on each call to the API.

REST/HTTP

Authentication for HTTP requests is performed by including an Authorization request header containing a JSON Web Token (JWT) with the prefix ‘Bearer ’. A valid JWT can be obtained by making a call to the MicroEdge authentication endpoint and passing your User ID and Private Key.

C# SDK

Authentication in the C# SDK is accomplished when instantiating the appropriate client object with your User ID (Key) and Private Key (Secret).

Request Parameters

REST/HTTP

All REST/HTTP requests are performed using POST. The body of the HTTP request will be a JSON object indicating the parameters of the endpoint. See this article for more information about the JSON format.

.NET SDK

All methods contained in SDK client classes accept a single parameter, which is an object of a type appropriate to the endpoint being called. This request object will contain the parameters needed for the method call.

Paging Results

Endpoints returning multiple records return paged responses. The request object will contain a perPage property indicating the number of results to return per page and a page property indicating which page of the results to return. If the perPage property is not provided, it defaults to 20. If the page property is not provided, it defaults to 1.

Query Parameters

Some endpoints allow you to return data based on pre-defined selection criteria. In these cases, the selection criteria will be contained in a Criteria object of the request. This criteria object will contain properties for the fields that can be searched on. When the field being searched is a date, decimal, or string, the associated value may be of type DateQueryCriteria, DecimalQueryCriteria, or StringQueryCriteria respectively. These special query types allow you more flexibility in selection criteria and are defined as follows:

DateQueryCriteria

The ISO 8601 date and time format (e.g. 2020-05-20) is the preferred format for datetime values. Other localized formats are accepted by the API, but the ISO 8601 format ensures the GIFTS Online API is reading your request code correctly. The W3 Consortium site has details about this format and more examples for reference.

In HTTP and cURL, the datetime value must be surrounded by quotes as per standard JSON formatting.

{ StartDate: [datetime], EndDate: [datetime], Is: [datetime] }
{ "startDate": [datetime], "endDate": [datetime], "is": [datetime] }

DecimalQueryCriteria

{ MinValue: [decimal], MaxValue: [decimal], Is: [decimal] }
{ "minValue": [decimal], "maxValue": [decimal], "is": [decimal] }

StringQueryCriteria

{ BeginsWith: [string], EndsWith: [string], Contains: [string], Is: [string] }
{ "beginsWith": [string], "endsWith": [string], "contains": [string], "is": [string] }

The update request endpoint provides functionality for updating custom fields on a request record. The field name refers to the name of the custom field as it is stored in your client database. Value can be provided with a date, decimal, string or integer. The value type should match the data type of the field being updated.

CustomField

{ FieldName: [string], Value: [object] }
{ fieldName: [string], value: [object] }

Response Objects

Endpoints that return entity data will return standard objects based on the entity queried.

Organization

Note that the custom fields of the organization will be returned in the CustomFields property as an object with a property for each custom field.

{ "id": [string], "name": [string], "legalName": [string], "sortAs": [string], "aka": [string], "primaryContact": { "id": [string], "email": [string], "name": [string] //First Middle Last }, "primaryAddress": { "id": [int], "address1": [string], "address2": [string], "city": [string], "stateProvince": [string], "postalCode": [string], "country": [string], "telephone": [string], "telephoneExt": [string] }, "email": [string], "url": [string], "vendorNo": [string], "taxId": [string], "taxStatusVerifyDate": [datetime], "taxStatusVerifierStaff": { "loginId": [string], "name": [string] }, "taxStatusNextVerifyDate": [datetime], "taxRegistrationDate": [datetime], "taxNotes": [string], "financialReportDate": [datetime], "isUnitedWay": [boolean], "isCharitable": [boolean], "background": [string], "branch": { "id": [int], "code": [string], "description": [string] }, "alertText": [string], "customFields": { "<customFieldName>": [object] } }

Note that the custom fields of the organization will be returned as a dictionary with a string key and an object value. There will be an entry in the dictionary for each custom field, the key of the entry being the custom field name and the value of the entry being the custom field value.

public class Organization { public string Id { get; set; } public string Name { get; set; } public string LegalName { get; set; } public string SortAs { get; set; } public string Aka { get; set; } public ContactReference PrimaryContact { get; set; } public Address PrimaryAddress { get; set; } public string Email { get; set; } public string Url { get; set; } public string VendorNo { get; set; } public string TaxId { get; set; } public DateTime? TaxStatusVerifyDate { get; set; } public Staff TaxStatusVerifierStaff { get; set; } public DateTime? TaxStatusNextVerifyDate { get; set; } public DateTime? TaxRegistrationDate { get; set; } public string TaxNotes { get; set; } public DateTime? FinancialReportDate { get; set; } public bool IsUnitedWay { get; set; } public bool IsCharitable { get; set; } public string Background { get; set; } public IdCodeDescription Branch { get; set; } public string AlertText { get; set; } public Dictionary<string, Object> CustomFields { get; set; } } public class ContactReference { public string Id { get; set; } public string Name { get; set; } public string Email { get; set; } } public class Address { public int Id { get; set; } public string Address1 { get; set; } public string Address2 { get; set; } public string City { get; set; } public string StateProvince { get; set; } public string PostalCode { get; set; } public string Country { get; set; } public string Telephone { get; set; } public string TelephoneExt { get; set; } } public class Staff { public string LoginId { get; set; } public string Name { get; set; } } public class IdCodeDescription { public int Id { get; set; } public string Code { get; set; } public string Description { get; set; } }

Contact

Note that the custom fields of the contact will be returned in the CustomFields property as an object with a property for each custom field.

{ "id": [string], "prefix": [string], "firstName": [string], "middleName": [string], "lastName": [string], "suffix": [string], "email": [string], "primaryOrganization": { "id": [string], "name": [string] }, "salutation": [string], "informalSalutation": [string], "addresseeSalutation": [string]; "primaryAddress": { "id": [int], "address1": [string], "address2": [string], "city": [string], "stateProvince": [string], "postalCode": [string], "country": [string], "telephone": [string], "telephoneExt": [string], "alternateTelephone": [string], "alternateTelephoneExt": [string] }, "officeAddress": { "id": [int], "address1": [string], "address2": [string], "city": [string], "stateProvince": [string], "postalCode": [string], "country": [string], "telephone": [string], "telephoneExt": [string], "alternateTelephone": [string], "alternateTelephoneExt": [string] }, "homeAddress": { "id": [int], "address1": [string], "address2": [string], "city": [string], "stateProvince": [string], "postalCode": [string], "country": [string], "telephone": [string], "telephoneExt": [string], "alternateTelephone": [string], "alternateTelephoneExt": [string] }, "jobTitle": [string], "isStudent": [boolean], "type": { "id": [int], "code": [string], "description": [string] }, "highestDegreeYear": [int], "highestDegree": { "id": [int], "code": [string], "description": [string] }, "notes": [string], "reviewerType": { "id": [int], "code": [string], "description": [string] }, "reviewerUser": { "loginId": [string], "name": [string] }, "birthDate": [datetime], "spouseName": [string], "countryOfCitizenship": [string], "startDate": [datetime], "terminationDate": [datetime], "retireDate": [datetime], "deathDate": [datetime], "alertText": [string], "branch": { "id": [int], "code": [string], "description": [string] } "customFields": { "<customFieldName>": [object] } }

Note that the custom fields of the contact will be returned as a dictionary with a string key and an object value. There will be an entry in the dictionary for each custom field, the key of the entry being the custom field name and the value of the entry being the custom field value.

public class Contact { public string Id { get; set; } public string Prefix { get; set; } public string FirstName { get; set; } public string MiddleName { get; set; } public string LastName { get; set; } public string Suffix { get; set; } public string Email { get; set; } public OrganizationReference PrimaryOrganization { get; set; } public string Salutation { get; set; } public string InformalSalutation { get; set; } public string AddresseeSalutation { get; set; } public Address PrimaryAddress { get; set; } public Address OfficeAddress { get; set; } public Address HomeAddress { get; set; } public string JobTitle { get; set; } public bool? IsStudent { get; set; } public IdCodeDescription Type { get; set; } public int? HighestDegreeYear { get; set; } public IdCodeDescription HighestDegree { get; set; } public string Notes { get; set; } public IdCodeDescription ReviewerType { get; set; } public Staff ReviewerUser { get; set; } public DateTime? BirthDate { get; set; } public string SpouseName { get; set; } public string CountryOfCitizenship { get; set; } public DateTime? StartDate { get; set; } public DateTime? TerminationDate { get; set; } public DateTime? RetireDate { get; set; } public DateTime? DeathDate { get; set; } public string AlertText { get; set; } public IdCodeDescription Branch { get; set; } public Dictionary<string, Object> CustomFields { get; set; } } public class OrganizationReference { public string Id { get; set; } public string Name { get; set; } } public class Address { public int Id { get; set; } public string Address1 { get; set; } public string Address2 { get; set; } public string City { get; set; } public string StateProvince { get; set; } public string PostalCode { get; set; } public string Country { get; set; } public string Telephone { get; set; } public string TelephoneExt { get; set; } public string AlternateTelephone { get; set; } public string AlternateTelephoneExt { get; set} } public class Staff { public string LoginId { get; set; } public string Name { get; set; } } public class IdCodeDescription { public int Id { get; set; } public string Code { get; set; } public string Description { get; set; } }

Request

Note that the custom fields of the request will be returned in the CustomFields property as an object with a property for each custom field.

{ "id": [string], "projectTitle": [string], "requestDate": [datetime], "approvalDate": [datetime], "disposition": [string], "dispositionDate": [datetime], "requestAmount": [decimal], "recommendedAmount": [decimal], "grantAmount": [decimal], "paidAmount": [decimal], "balance": [decimal], "organization": { "id": [string], "name": [string] }, "contact": { "id": [string], "email": [string], "name": [string] //First Middle Last }, "status": { "id": [int], "code": [string], "description": [string] }, "statusDate": [datetime], "type": { "id": [int], "code": [string], "description": [string] }, "referenceNumber": [string], "projectStartDate": [datetime], "projectEndDate": [datetime], "declinationReason": { "id": [int], "code": [string], "description": [string] }, "declinationNotes": [string], "isComplete": [boolean], "completeDate": [datetime], "grantFiscalYear": [int], "termMonths": [int], "completeNotes": [string], "meetingDate": [datetime], "meetingMinutes": [string], "docketNumber": [string], "branch": { "id": [int], "code": [string], "description": [string] }, "staff": { "loginId": [string], "name": [string] }, "secondaryStaff": { "loginId": [string], "name": [string] }, "subdivision": [string] "paymentsCount": [int], "alert": [string], "changeDate": [datetime], "codings": [ { "id": [int], "codeTable": { "id": [int], "description": [string] }, "level1": { "id": [int], "code": [string], "description": [string] }, "level2": { "id": [int], "code": [string], "description": [string] }, "level3": { "id": [int], "code": [string], "description": [string] }, "level4": { "id": [int], "code": [string], "description": [string] }, "level5": { "id": [int], "code": [string], "description": [string] }, "allocationPercentage": [int], "allocationAmount": [int], "isPrimary": [boolean] } ], "customFields": { "<customFieldName>": [object] } }

Note that the custom fields of the request will be returned as a dictionary with a string key and an object value. There will be an entry in the dictionary for each custom field, the key of the entry being the custom field name and the value of the entry being the custom field value.

public class Request { public string Id { get; set; } public string ProjectTitle { get; set; } public DateTime? RequestDate { get; set; } public DateTime? ApprovalDate { get; set; } public string Disposition { get; set; } public DateTime? DispositionDate { get; set; } public decimal? RequestAmount { get; set; } public decimal? RecommendedAmount { get; set; } public decimal? GrantAmount { get; set; } public decimal? PaidAmount { get; set; } public decimal? Balance { get; set; } public OrganizationReference Organization { get; set; } public ContactReference Contact { get; set; } public IdCodeDescription Status { get; set; } public DateTime? StatusDate { get; set; } public IdCodeDescription Type { get; set; } public string ReferenceNumber { get; set; } public DateTime? ProjectStartDate { get; set; } public DateTime? ProjectEndDate { get; set; } public IdCodeDescription DeclinationReason { get; set; } public string DeclinationNotes { get; set; } public bool IsComplete { get; set; } public DateTime? CompleteDate { get; set; } public short? GrantFiscalYear { get; set; } public int? TermMonths { get; set; } public string CompleteNotes { get; set; } public DateTime? MeetingDate { get; set; } public string MeetingMinutes { get; set; } public string DocketNumber { get; set; } public IdCodeDescription Branch { get; set; } public Staff Staff { get; set; } public Staff SecondaryStaff { get; set; } public string Subdivision { get; set; } public int? PaymentsCount { get; set; } public string Alert { get; set; } public DateTime? ChangeDate { get; set; } public List<Coding> Codings { get; set; } public Dictionary<string, Object> CustomFields { get; set; } } public class OrganizationReference { public string Id { get; set; } public string Name { get; set; } } public class ContactReference { public string Id { get; set; } public string Name { get; set; } public string Email { get; set; } } public class Staff { public string LoginId { get; set; } public string Name { get; set; } } public class IdCodeDescription { public int Id { get; set; } public string Code { get; set; } public string Description { get; set; } } public class Coding { public int Id { get; set; } public CodeTable CodeTable { get; set; } public IdCodeDescription Level1 { get; set; } public IdCodeDescription Level2 { get; set; } public IdCodeDescription Level3 { get; set; } public IdCodeDescription Level4 { get; set; } public IdCodeDescription Level5 { get; set; } public short? AllocationPercentage { get; set; } public decimal? AllocationAmount { get; set; } public bool IsPrimary { get; set; } }

Payment

Note that the custom fields of the payment will be returned in the CustomFields property as an object with a property for each custom field.

{ "id": [int], "request": { "id": [string], "projectTitle": [string], "disposition": [string] }, "organization": { "id": [string], "name": [string] }, "contact": { "id": [string], "email": [string], "name": [string] //First Middle Last }, "status": { "id": [int], "code": [string], "description": [string] }, "statusDate": [datetime], "type": { "id": [int], "code": [string], "description": [string] }, "scheduleDate": [datetime], "amount": [decimal], "datePaid": [datetime], "fund": { "id": [int], "code": [string], "description": [string] }, "supportType": { "id": [int], "code": [string], "description": [string] }, "glAccount": { "id": [int], "code": [string], "description": [string] }, "taxValueAmount": [decimal], "bookValueAmount": [decimal], "inKindDescription": [string], "deductibleAmount": [decimal], "quidProQuoAmount": [decimal], "quidProQuoDescription": [string], "paymentNumber": [int], "checkNo": [string], "notes": [string], "checkClearedDate": [datetime], "invoiceNo": [string], "subdivision": [string], "voidDate": [datetime], "voidId": [int], "reissueId": [int], "originalId": [int], "alertText": [string], "branch": { "id": [int], "code": [string], "description": [string] }, "customFields": { "<customFieldName>": [object] } }

Note that the custom fields of the payment will be returned as a dictionary with a string key and an object value. There will be an entry in the dictionary for each custom field, the key of the entry being the custom field name and the value of the entry being the custom field value.

public class Payment { public int Id { get; set; } public RequestReference Request { get; set; } public OrganizationReference Organization { get; set; } public ContactReference Contact { get; set; } public IdCodeDescription Status { get; set; } public DateTime? StatusDate { get; set; } public IdCodeDescription Type { get; set; } public DateTime? ScheduleDate { get; set; } public decimal? Amount { get; set; } public DateTime? DatePaid { get; set; } public IdCodeDescription Fund { get; set; } public IdCodeDescription SupportType { get; set; } public IdCodeDescription GlAccount { get; set; } public decimal? TaxValueAmount { get; set; } public decimal? BookValueAmount { get; set; } public string InKindDescription { get; set; } public decimal? DeductibleAmount { get; set; } public decimal? QuidProQuoAmount { get; set; } public string QuidProQuoDescription { get; set; } public int? PaymentNumber { get; set; } public string CheckNo { get; set; } public string Notes { get; set; } public DateTime? CheckClearedDate { get; set; } public string InvoiceNo { get; set; } public string Subdivision { get; set; } public DateTime? VoidDate { get; set; } public int? VoidId { get; set; } public int? ReissueId { get; set; } public int? OriginalId { get; set; } public string AlertText { get; set; } public IdCodeDescription Branch { get; set; } public Dictionary<string, Object> CustomFields { get; set; } } public class RequestReference { public string Id { get; set; } public string ProjectTitle { get; set; } public string Disposition { get; set; } } public class OrganizationReference { public string Id { get; set; } public string Name { get; set; } } public class ContactReference { public string Id { get; set; } public string Name { get; set; } public string Email { get; set; } } public class IdCodeDescription { public int Id { get; set; } public string Code { get; set; } public string Description { get; set; } }

Requirement

Note that the custom fields of the requirement will be returned in the CustomFields property as an object with a property for each custom field.

{ "id": [int], staff: { "loginId": [string], "name": [string] }, "request": { "id": [string], "projectTitle": [string], "disposition": [string] }, "organization": { "id": [string], "name": [string] }, "contact": { "id": [string], "email": [string], "name": [string] //First Middle Last }, "payment": { "id": [int], "amount": [decimal] }, "type": { "id": [int], "code": [string], "description": [string] }, "class": { "id": [int], "code": [string], "description": [string] }, "scheduleDate": [datetime], "receivedDate": [datetime], "doneDate": [datetime], "isDone": [boolean], "doneUser": { "loginId": [string], "name": [string] }, "isPaymentContingent": [boolean], "notes": [string], "longNotes": [string] "branch": { "id": [int], "code": [string], "description": [string] }, "customFields": { "<customFieldName>": [object] } }

Note that the custom fields of the requirement will be returned as a dictionary with a string key and an object value. There will be an entry in the dictionary for each custom field, the key of the entry being the custom field name and the value of the entry being the custom field value.

public class Requirement { public int? Id { get; set; } public Staff Staff { get; set; } public RequestReference Request { get; set; } public OrganizationReference Organization { get; set; } public ContactReference Contact { get; set; } public PaymentReference Payment { get; set; } public IdCodeDescription Type { get; set; } public IdCodeDescription Class { get; set; } public DateTime? ScheduleDate { get; set; } public DateTime? ReceivedDate { get; set; } public DateTime? DoneDate { get; set; } public bool IsDone { get; set; } public Staff DoneUser { get; set; } public bool IsPaymentContingent { get; set; } public string Notes { get; set; } public string LongNotes { get; set; } public IdCodeDescription Branch { get; set; } public Dictionary<string, Object> CustomFields { get; set; } } public class RequestReference { public string Id { get; set; } public string ProjectTitle { get; set; } public string Disposition { get; set; } } public class OrganizationReference { public string Id { get; set; } public string Name { get; set; } } public class ContactReference { public string Id { get; set; } public string Name { get; set; } public string Email { get; set; } } public class PaymentReference { public int Id { get; set; } public decimal? Amount { get; set; } } public class Staff { public string LoginId { get; set; } public string Name { get; set; } } public class IdCodeDescription { public int Id { get; set; } public string Code { get; set; } public string Description { get; set; } }

To Do

Note that the custom fields of the to do activity will be returned in the CustomFields property as an object with a property for each custom field.

{ "id": [int], "request": { "id": [string], "projectTitle": [string], "disposition": [string] }, "organization": { "id": [string], "name": [string] }, "contact": { "id": [string], "email": [string], "name": [string] //First Middle Last }, "payment": { "id": [int], "amount": [decimal] }, "type": { "id": [int], "code": [string], "description": [string] }, "class": { "id": [int], "code": [string], "description": [string] }, "scheduleDate": [datetime], "duration": [int], "doneDate": [datetime], "staff": { "loginId": [string], "name": [string] }, "isDone": [boolean], "notes": [string], "longNotes": [string], "branch": { "id": [int], "code": [string], "description": [string] }, "customFields": { "<customFieldName>": [object] } }

Note that the custom fields of the to do activity will be returned as a dictionary with a string key and an object value. There will be an entry in the dictionary for each custom field, the key of the entry being the custom field name and the value of the entry being the custom field value.

public class Todo { public int Id { get; set; } public RequestReference Request { get; set; } public OrganizationReference Organization { get; set; } public ContactReference Contact { get; set; } public PaymentReference Payment { get; set; } public IdCodeDescription Type { get; set; } public IdCodeDescription Class { get; set; } public DateTime? ScheduleDate { get; set; } public int? Duration { get; set; } public DateTime? DoneDate { get; set; } public Staff Staff { get; set; } public bool IsDone { get; set; } public string Notes { get; set; } public string LongNotes { get; set; } public IdCodeDescription Branch { get; set; } public Dictionary<string, Object> CustomFields { get; set; } } public class RequestReference { public string Id { get; set; } public string ProjectTitle { get; set; } public string Disposition { get; set; } } public class OrganizationReference { public string Id { get; set; } public string Name { get; set; } } public class ContactReference { public string Id { get; set; } public string Name { get; set; } public string Email { get; set; } } public class PaymentReference { public int Id { get; set; } public decimal? Amount { get; set; } } public class Staff { public string LoginId { get; set; } public string Name { get; set; } } public class IdCodeDescription { public int Id { get; set; } public string Code { get; set; } public string Description { get; set; } }

Organization Endpoints

GetOrganization

Get a specific Organization based on ID.

POST https://api.microedge.com/goapi/organization/getOrganization HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new OrganizationClient(key, secret)) {
    var request = new GetOrganizationRequest {Id = "1"};
    var response = sdkClient.GetOrganization(request).Result;
    var organization = response.Organization;
}

Request

public class GetOrganizationRequest { public string Id { get; set; } }
{ "id": [string] }

Response

public class GetOrganizationResponse { public Organization Organization { get; set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "organization": [Organization], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetOrganizations

Get Organizations based on search criteria. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/organization/getOrganizations HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new OrganizationClient(key, secret)) {
    var request = new GetOrganizationsRequest
    {
        Criteria =
        {
            City =
            {
                BeginsWith = "New"
            }
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetOrganizations(request).Result;
    var organizations = response.Organizations;
}

Request

public class GetOrganizationsRequest { public OrganizationQueryCriteria Criteria { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } } public class OrganizationQueryCriteria { public StringQueryCriteria Name { get; set; } public StringQueryCriteria LegalName { get; set; } public string Id { get; set; } public StringQueryCriteria City { get; set; } public StringQueryCriteria State { get; set; } public StringQueryCriteria PostalCode { get; set; } public int? TaxStatus1Id { get; set; } public int? TaxStatus2Id { get; set; } public int? OrganizationTypeId { get; set; } }
{ "criteria": { "id": [string], "name": [StringQueryCriteria], "legalName": [StringQueryCriteria], "city": [StringQueryCriteria], "state": [StringQueryCriteria], "postalCode": [StringQueryCriteria], "taxStatus1Id": [int], "taxStatus2Id": [int], "organizationTypeId": [int] }, "perPage": [int], "page": [int] }

Response

public class GetOrganizationsResponse { public List<Organization> Organizations { get; private set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "organizations": [ [Organization] ], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

UpdateOrganization

Update certain fields of a single Organization.

POST https://api.microedge.com/goapi/organization/updateOrganization HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new OrganizationClient(key, secret)) {
    var request = new UpdateOrganizationRequest
    {
        Id = "1",
        VendorNo = "1234"
    };
    var response = sdkClient.UpdateOrganization(request).Result;
}

Request

You currently may update the Tax ID and Vendor No fields. If the value of the associated property in the request is set to null, the associated field will not be updated.

public class UpdateOrganizationRequest { public string Id { get; set; } public string TaxId { get; set; } public string VendorNo { get; set; } }
{ "id": [string], "taxId": [string], "vendorNo": [string] }

Response

public class UpdateOrganizationResponse { public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "status": [string], "message": [string], "isSuccessStatus": [boolean] }

Contact Endpoints

GetContact

Get a specific Contact based on ID.

POST https://api.microedge.com/goapi/contact/getContact HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new ContactClient(key, secret)) {
    var request = new GetContactRequest {Id = "1"};
    var response = sdkClient.GetContact(request).Result;
    var contact = response.Contact;
}

Request

public class GetContactRequest { public string Id { get; set; } }
{ "id": [string] }

Response

public class GetContactResponse { public Contact Contact { get; set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "contact": [Contact], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetContacts

Get Contacts based on search criteria. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/contact/getContacts HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new ContactClient(key, secret)) {
    var request = new GetContactsRequest
    {
        Criteria =
        {
            City =
            {
                BeginsWith = "New"
            }
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetContacts(request).Result;
    var contacts = response.Contacts;
}

Request

public class GetContactsRequest { public ContactQueryCriteria Criteria { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } } public class ContactQueryCriteria { public string Id { get; set; } public StringQueryCriteria City { get; set; } public StringQueryCriteria State { get; set; } public StringQueryCriteria PostalCode { get; set; } public int? ContactTypeId { get; set; } public int? ReviewerTypeId { get; set; } public bool? IsActiveStudent { get; set; } } }
{ "criteria": { "id": [string], "city": [StringQueryCriteria], "state": [StringQueryCriteria], "postalCode": [StringQueryCriteria], "contactTypeId": [int], "reviewerTypeId": [int], "isActiveStudent": [boolean] }, "perPage": [int], "page": [int] }

Request Endpoints

GetRequest

Get a specific Request based on ID.

POST https://api.microedge.com/goapi/request/getRequest HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new RequestClient(key, secret)) {
    var request = new GetRequestRequest {Id = "1"};
    var response = sdkClient.GetRequest(request).Result;
    var request = response.Request;
}

Request

public class GetRequestRequest { public string Id { get; set; } }
{ id: [string] }

Response

public class GetRequestResponse { public Request Request { get; set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "request": [Request], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetRequestsById

Get Requests for a provided list of IDs. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/request/getRequestsById HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new RequestClient(key, secret)) {
    var request = new GeRequestsByIdRequest
    {
        Ids = new List<string>() { "1" },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetRequestsById(request).Result;
    var requests = response.Requests;
}

Request

public class GetRequestRequest { public List Ids { get; set; } }
{ ids: [ [string] ] }

Response

public class GetRequestResponse { public List Requests { get; set; } }
{ "requests": [ [Request] ], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetRequests

Get Requests based on search criteria. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/request/getRequests HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new RequestClient(key, secret)) {
    var request = new GeRequestsRequest
    {
        Criteria =
        {
            City =
            {
                BeginsWith = "New"
            }
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetRequests(request).Result;
    var requests = response.Requests;
}
curl -v -X POST "https://api.microedge.com/goapi/request/getRequests" ^
-H "Content-Type: application/json" ^
-H "Authorization: Bearer <token>" ^
--data-ascii "{'criteria':{'disposition': 'Approved'},'perPage': 5,'page': 1}"

Request

public class GetRequestsRequest { public RequestQueryCriteria Criteria { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } } public class RequestQueryCriteria { public string Id { get; set; } public DateQueryCriteria RequestDate { get; set; } public int? BranchId { get; set; } public string Disposition { get; set; } //Approved, Pending, or Declined public DateQueryCriteria DispositionDate { get; set; } public DecimalQueryCriteria GrantAmount { get; set; } public DateQueryCriteria ProjectStartDate { get; set; } public DateQueryCriteria ProjectEndDate { get; set; } public DecimalQueryCriteria RecommendedAmount { get; set; } public DecimalQueryCriteria RequestedAmount { get; set; } public int? RequestTypeId { get; set; } public int? RequestStatusId { get; set; } public string StaffId { get; set; } public string SecondaryStaffId { get; set; } public int? AgeGroupId { get; set; } public int? EthnicityId { get; set; } public int? FundId { get; set; } public int? GenderId { get; set; } public int? GeographicalAreaServedId { get; set; } public int? InternalProgramId { get; set; } public int? PopulationServedId { get; set; } public int? ProgramAreaId { get; set; } public int? TypeOfSupportId { get; set; } }
{ criteria: { "id": [string], "requestDate": [DateQueryCriteria], "branchId": [int], "disposition": [string (Approved, Pending, or Declined)], "dispositionDate": [DateQueryCriteria], "grantAmount": [DecimalQueryCriteria], "projectStartDate": [DateQueryCriteria], "projectEndDate": [DateQueryCriteria], "recommendedAmount": [DecimalQueryCriteria], "requestedAmount": [DecimalQueryCriteria], "requestTypeId": [int], "requestStatusId": [int], "staffId": [string], "secondaryStaffId": [string] "ageGroupId": [int], "ethnicityId": [int], "fundId": [int], "genderId": [int], "geographicalAreaServedId": [int], "internalProgramId": [int], "populationServedId": [int], "programAreaId": [int], "typeOfSupportId": [int], "custom": [ { "fieldName": [string], "dateCriteria": [DateQueryCriteria], "decimalCriteria": [DecimalQueryCriteria], "stringCriteria": [StringQueryCriteria], "integerCriteria": [int] } ] }, perPage: [int], page: [int] }

UpdateRequest

Update certain fields of a single Request.

POST https://api.microedge.com/goapi/request/updateRequest HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new RequestClient(key, secret)) {
    var request = new UpdateRequestRequest
    {
        Id = "1",
        Custom = new List<CustomField>()
        {
            new CustomField()
            {
                FieldName = "date_field_name",
                DateValue = DateTime.Parse("1/1/2001")
            },
            new CustomField()
            {
                FieldName = "decimal_field_name",
                DecimalValue = (decimal)123
            },
            new CustomField()
            {
                FieldName = "string_field_name",
                StringValue = "Text value"
            },
            new CustomField()
            {
                FieldName = "integer_field_name",
                IntegerValue = (int)123
            }            
        }
    };
    var response = sdkClient.UpdateRequest(request).Result;
}

Request

You currently may update custom fields on a request record. Custom fields are included as a list in the HTTP request. Each custom field to be updated should include the field name and the value it will be updated to. Only one value property (DateValue, DecimalValue, StringValue or IntegerValue) should be set per CustomField. The value type should match the data type of the field being updated. Values included on incompatible data types will be ignored.

If the value of the associated property in the request is set to null, the associated field will not be updated.

public class UpdateRequestRequest { public string Id { get; set; } public List<CustomField> Custom { get; set; } } public class CustomField { public string FieldName { get; set; } public DateTime? DateValue { get; set; } public decimal? DecimalValue { get; set; } public string StringValue { get; set; } public int? IntegerValue { get; set; } }
{ "id": [string], "custom": [ [CustomField] ] }

Response

public class UpdateRequestResponse { public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "status": [string], "message": [string], "isSuccessStatus": [boolean] }

Payment Endpoints

GetPayment

Get a specific Payment based on ID.

POST https://api.microedge.com/goapi/payment/getPayment HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new GetPaymentRequest {Id = 1};
    var response = sdkClient.GetPayment(request).Result;
    var payment = response.Payment;
}

Request

public class GetPaymentRequest { public int Id { get; set; } }
{ "id": [int] }

Response

public class GetPaymentResponse { public Payment Payment { get; set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "payment": [Payment], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetPayments

Get Payments based on search criteria. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/payment/getPayments HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new GetPaymentsRequest
    {
        Criteria =
        {
            ScheduleDate =
            {
                StartDate = "2016-05-01",
                EndDate = "2016-05-31"
            }
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetPayments(request).Result;
    var payments = response.Payments;
}

Request

public class GetPaymentsRequest { public PaymentQueryCriteria Criteria { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } } public class PaymentQueryCriteria { public DateQueryCriteria ScheduleDate { get; set; } public DecimalQueryCriteria Amount { get; set; } public int? GlAccountId { get; set; } public int? FundId { get; set; } public int? PaymentTypeId { get; set; } public int? SupportTypeId { get; set; } }
{ "criteria": { "scheduleDate": [DateQueryCriteria], "amount": [DecimalQueryCriteria], "glAccountId": [int], "fundId": [int], "paymentTypeId": [int], "supportTypeId": [int] }, "perPage": [int], "page": [int] }

Response

public class GetPaymentsResponse { public List<Payment> Payments { get; private set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "payments": [ [Payment] ], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetScheduledPayments

Get scheduled Payments for approved Requests for a specified Schedule Date range. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/payment/getScheduledPayments HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new GetScheduledPaymentsRequest
    {
        Criteria =
        {
            ScheduleDate =
            {
                StartDate = "2016-05-01",
                EndDate = "2016-05-31"
            }
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetScheduledPayments(request).Result;
    var payments = response.Payments;
}

Request

public class GetScheduledPaymentsRequest { public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } }
{ "startDate": [datetime], "endDate": [datetime], "perPage": [int], "page": [int] }

Response

public class GetScheduledPaymentsResponse { public List<Payment> Payments { get; private set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "payments": [ [Payment] ], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

PayPayment

Pay a scheduled Payment, changing its status to paid and setting the payment date, check number, and notes of the payment.

POST https://api.microedge.com/goapi/payment/payPayment HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new PayPaymentRequest
    {
        Id = 1234,
        PaidDate = "2016-12-01",
        CheckNumber = "98293"
    };
    var response = sdkClient.PayPayment(request).Result;
}

Request

public class PayPaymentRequest { public int Id { get; set; } public DateTime? PaidDate { get; set; } public string CheckNumber { get; set; } public string Notes { get; set; } }
{ "id": [int], "paidDate": [datetime], "checkNumber": [string], "notes": [string] }

Response

public class PayPaymentResponse { public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "status": [string], "message": [string], "isSuccessStatus": [boolean] }

CancelPayment

Cancel a scheduled Payment, changing its status to cancelled.

POST https://api.microedge.com/goapi/payment/cancelPayment HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new CancelPaymentRequest
    {
        Id = 1234
    };
    var response = sdkClient.CancelPayment(request).Result;
}

Request

public class CancelPaymentRequest { public int Id { get; set; } }
{ "id": [int] }

Response

public class CancelPaymentResponse { public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "status": [string], "message": [string], "isSuccessStatus": [boolean] }

VoidPayment

Void a paid Payment, creating a new Payment with a status of void and a negative amount.

POST https://api.microedge.com/goapi/payment/voidPayment HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new VoidPaymentRequest
    {
        Id = 1234
    };
    var response = sdkClient.VoidPayment(request).Result;
}

Request

public class VoidPaymentRequest { public int Id { get; set; } }
{ "id": [int] }

Response

public class VoidPaymentResponse { public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "status": [string], "message": [string], "isSuccessStatus": [boolean] }

RefundPayment

Refund a paid Payment, creating a new Payment with a status of refund with the specified amount, fiscal year, schedule date, and payment date.

NOTE: In order to create a refund payment, it must belong to an approved request with a grant amount exceeding the total payment amount by the amount of the refund payment. Also, the new refund payment must not belong to a budget in which its request type or the default payment type require budget appropriation.

POST https://api.microedge.com/goapi/payment/refundPayment HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new PaymentClient(key, secret)) {
    var request = new RefundPaymentRequest
    {
        Id = 1234,
        Amount = 1000,
        FiscalYear = 2016,
        ScheduledDate = "2016-12-30",
        PaymentDate = "2016-12-30"
    };
    var response = sdkClient.VoidPayment(request).Result;
}

Request

public class RefundPaymentRequest { public int Id { get; set; } public Decimal? Amount { get; set; } public short? FiscalYear { get; set; } public DateTime? ScheduledDate { get; set; } public DateTime? PaymentDate { get; set; } }
{ "id": [int], "amount": [decimal], "fiscalYear": [int], "scheduleDate": [datetime], "paymentDate": [datetime] }

Response

public class RefundPaymentResponse { public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "status": [string], "message": [string], "isSuccessStatus": [boolean] }

Requirement Endpoints

GetRequirement

Get a specific Requirement based on ID.

POST https://api.microedge.com/goapi/requirement/getRequirement HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new RequirementClient(key, secret)) {
    var request = new GetRequirementRequest {Id = 1};
    var response = sdkClient.GetRequirement(request).Result;
    var requirement = response.Requirement;
}

Request

public class GetRequirementRequest { public int Id { get; set; } }
{ "id": [int] }

Response

public class GetRequirementResponse { public Requirement Requirement { get; set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "requirement": [Requirement], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetRequirements

Get Requirements based on search criteria. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/requirement/getRequirements HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new RequirementClient(key, secret)) {
    var request = new GetRequirementsRequest
    {
        Criteria =
        {
            StaffId = "BEN"
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetRequirements(request).Result;
    var requirements = response.Requirements;
}

Request

public class GetRequirementsRequest { public RequirementQueryCriteria Criteria { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } } public class RequirementQueryCriteria { public int? TypeId { get; set; } public DateQueryCriteria ReceivedDate { get; set; } public DateQueryCriteria DoneDate { get; set; } public string StaffId { get; set; } }
{ "criteria": { "typeId": [int], "receivedDate": [DateQueryCriteria], "doneDate": [DateQueryCriteria], "staffId": [string] }, "perPage": [int], "page": [int] }

Response

public class GetRequirementsResponse { public List<Requirement> Requirements { get; private set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "requirements": [ [Requirement] ], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

To Do Endpoints

GetTodo

Get a specific To Do Activity based on ID.

POST https://api.microedge.com/goapi/todo/getTodo HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new TodoClient(key, secret)) {
    var request = new GetTodoRequest {Id = 1};
    var response = sdkClient.GetTodo(request).Result;
    var todo = response.Todo;
}

Request

public class GetTodoRequest { public int Id { get; set; } }
{ "id": [int] }

Response

public class GetTodoResponse { public Todo Todo { get; set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "todo": [Todo], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

GetTodos

Get To Do Activities based on search criteria. Paging of results can be accomplished by specifying PerPage and Page values in the request.

POST https://api.microedge.com/goapi/todo/getTodos HTTP/1.1
Authorization: Bearer <token>
using (var sdkClient = new TodoClient(key, secret)) {
    var request = new GetTodosRequest
    {
        Criteria =
        {
            StaffId = "BEN"
        },
        PerPage = 10,
        Page = 1
    };
    var response = sdkClient.GetTodos(request).Result;
    var todos = response.Todos;
}

Request

public class GetTodosRequest { public TodoQueryCriteria Criteria { get; set; } public int? PerPage { get; set; } public int? Page { get; set; } } public class TodoQueryCriteria { public int? Id { get; set; } public int? ClassId { get; set; } public int? TypeId { get; set; } public DateQueryCriteria DoneDate { get; set; } public DateQueryCriteria DueDate { get; set; } public DateQueryCriteria ReceivedDate { get; set; } public string RequestId { get; set; } public string StaffId { get; set; } }
{ "criteria": { "id": [int], "classId": [int], "typeId": [int], "doneDate": [DateQueryCriteria], "dueDate": [DateQueryCriteria], "receivedDate": [DateQueryCriteria], "requestId": [string], "staffId": [string] }, "perPage": [int], "page": [int] }

Response

public class GetTodosResponse { public List<Todo> Todos { get; private set; } public string Status { get; set; } public string Message { get; set; } public bool IsSuccessStatus { get; set; } }
{ "todos": [ [Todo] ], "status": [string], "message": [string], "isSuccessStatus": [boolean] }

Error Explanations

Some common error conditions may be returned from the GIFTS Online API. This section will enumerate possible conditions as well as how to mitigate them.

There are two types of errors for the Payment endpoints, validation errors and budget module errors. The budget module errors can only be returned if the budget module is enabled.

Pay Payment Errors

Validation Errors

Budget Module Errors

Void Payment Errors

Validation Errors

Budget Module Errors

Cancel Payment Errors

Validation Errors

Budget Module Errors

Refund Payment Errors

Organization Errors