Skip to content

Latest commit

 

History

History
110 lines (81 loc) · 2.5 KB

File metadata and controls

110 lines (81 loc) · 2.5 KB

#API Object: marketplace.AgencyResource#

#####Definition: Use the /agency API to return a list of agencies in the system.

#####How it works:##### A system makes a call to Marketplace asking for a list of agencies. To make this call, one of the following REST Calls will request an agency media type. ????Is this right?

#####Request URL:#####

https://localhost:8443/marketplace/api/agency

#####Request Method:##### GET, Form_Method:none ???? where do i find form method?

#####Requirements:##### none

Optional: offset, max

#####Response:##### Marketplace returns the matching agency ID, as shown below. However, if the ID is an empty string, Marketplace will return a list of all agencies.

{ "id": 1, "shortName": "TORG", "title": "Test Organization", "_links": { "self": { "href": "https://localhost:8443/marketplace/api/agency/1" } } }

#####How to use it:##### Use it to find specific information about an agency or view all agency data in Marketplace.


###Example###

The following is an example of a call to get an agency ID: ???? I don't know how to do this

This is **NOT** accurate--just placeholder

var onSuccess = function(obj) {
    if (obj.value) {
        alert(obj.value.namespace);
    }
};

var onFailure = function(error) {
    alert(error);
};

OWF.Preferences.getWidget({
    widgetId:'eb5435cf-4021-4f2a-ba69-dde451d12551',
    onSuccess:onSuccess,
    onFailure:onFailure
});

###Resource Information###

Parameter Description
id The numerical ID associated with the agency object.
shortName The abbreviation used to identify the agency on listings' short and detailed views.
title The name of the agency.
links Links associated with the agency.

###Possible Errors###

???? where do i find the errors? NOT ACCURATE

Error Action
This will happen when getWidget is called using a widgetId that doesn't exist. HTTP Status 404: “...Widget with guid of undefined not found.” Make sure widgetId is set to a non-null string.