AppDirect API Reference
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The AppDirect API Reference lists various requests that you can use to manage and interact with your marketplace.
Use the following URL format to send API calls:
https://{marketplaceURL}/api/{endpoint}
For example:
https://myMarketplace.com/api/marketplace/v1/bundles
Generated on Fri Nov 24 2023 00:35:27 GMT-0500 (EST)
Bundles
Retrieve a bundle status
This call returns the current state of the bundle.
Example request
curl -X GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
[
{
"assigned": false,
"companyEntitlementId": null,
"companyEntitlementPending": false,
"companyWide": false,
"editionId": null,
"editionPricingId": null,
"freeTrialAllowed": true,
"freeTrialDaysLeft": 0,
"ownerAdmin": false,
"ownerFullName": null,
"ownerId": null,
"ownerUuid": null,
"partOfExistingBundle": false,
"pending": false,
"pendingAppType": "REQUESTED",
"requested": false
}
]
GET/marketplace/v1/bundles/{bundleId}/status
Retrieve a bundle status This call returns the current state of the bundle.
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*bundleId | path | number | Bundle product id |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Bundle application status read. | array of UserAppInfo |
404 | Not Found | Bundle application not found. |
Retrieve a bundle
This call returns all details about a specific bundle.
Example request
curl -X GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"billingFrequency": null,
"blurb": "Bundle Blurb",
"bundledProducts": [],
"buyable": false,
"changeSubscriptionAllowed": true,
"collectLeads": false,
"collectLeadsWithPurchaseEnabled": false,
"description": "Bundle Description",
"discountDetails": null,
"downloadFileSize": null,
"featured": false,
"featuredSliderPosition": null,
"free": false,
"freeTrialOrEditionPresent": false,
"href": "http://localhost/api/marketplace/v1/bundles/245",
"iconUrl": null,
"id": 245,
"lastModified": 1461792750786,
"name": "MockApp-4393604041692298141",
"newSubscriptionEnabled": true,
"numRatings": null,
"overview": null,
"overviewImageUrl": null,
"popular": false,
"popularity": null,
"productType": "BUNDLE",
"profileLogoUrl": null,
"provider": {
"name": "Appdirect",
"url": "appdirect.com",
"uuid": "b863d403-f8a7-4d38-9f89-c5fa021c2b7e"
},
"publishedOn": 1461792750665,
"rating": null,
"referable": false,
"staffPick": false,
"staffPickSliderPosition": null,
"startingPrice": null,
"supportedLanguages": [
"en"
],
"tags": [],
"url": "http://localhost/apps/245"
}
GET/marketplace/v1/bundles/{bundleId}
Retrieve a bundle This call returns all details about a specific bundle.
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*bundleId | path | number | Bundle product id |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Bundle application read. | Bundle |
404 | Not Found | Bundle application not found. |
List all bundles
This call lists all bundles on the marketplace.
Example request
curl -X GET https://{marketplaceURL}/api/marketplace/v1/bundles \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/marketplace/v1/bundles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/marketplace/v1/bundles',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/marketplace/v1/bundles',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/marketplace/v1/bundles', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/marketplace/v1/bundles',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/marketplace/v1/bundles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
[
{
"addon": false,
"billingFrequency": "MONTHLY",
"blurb": "Bundle Blurb",
"bundleUrls": [],
"bundledProducts": [],
"buyable": false,
"collectLeads": false,
"description": "Bundle Description",
"developerName": "Appdirect",
"discountDetails": null,
"downloadFileSize": null,
"featured": false,
"featuredSliderPosition": null,
"free": false,
"freeTrialOrEditionPresent": true,
"hasLyncToPhone": false,
"hidePricings": false,
"href": "http://localhost/api/marketplace/v1/bundles/257",
"iconUrl": null,
"id": 257,
"lastModified": 1461792752644,
"name": "MockApp3891706169852983393",
"numRatings": null,
"overview": null,
"overviewImageUrl": null,
"popular": false,
"popularity": null,
"productType": "BUNDLE",
"profileLogoUrl": null,
"publishedOn": 1461792752534,
"rating": null,
"referable": false,
"sortRank": 5,
"staffPick": false,
"staffPickSliderPosition": null,
"startingPrice": "$0.00/User/Mo",
"supportedLanguages": [
"en"
],
"tags": [],
"url": "http://localhost/apps/257",
"uuid": "df44129f-3c03-40eb-a112-b04e455b8c3f",
"vendorName": "Appdirect"
}
]
GET/marketplace/v1/bundles
List all bundles This call lists all bundles on the marketplace.
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | List of product bundle. | array of BundleListing |
Checkout Items
Get item details
Example request
curl -X POST https://{marketplaceURL}/api/v3/checkout/items \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/v3/checkout/items HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/v3/checkout/items',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"bundleIds": [
"300",
"400"
],
"buyerCompanyId": "6e5a0af2-e6be-4a86-a1b0-ffabcc2c6324",
"buyerUserId": "55144410-a14a-43a1-9e0a-062c6cf31770",
"currency": "USD",
"ownerCompanyId": "b0410709-8333-43e2-84d6-3228f6b9998b",
"ownerUserId": "19d7343b-b8ab-464a-a893-8b107d77137d",
"pricingPlanIds": [
"a12bcf2e-d27e-4808-aae0-6099cc828664",
"3e0a22d3-dafb-4b3d-a487-7f4e7a94b32a"
],
"productIds": [
"100",
"200"
],
"subscriptionIds": [
"915a6558-5a1b-446a-8ec6-334cc60e3d37",
"8569269e-4c7f-4238-807c-513c718be135"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/v3/checkout/items',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/v3/checkout/items', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/v3/checkout/items',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/v3/checkout/items");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"bundleIds": [
"300",
"400"
],
"buyerCompanyId": "6e5a0af2-e6be-4a86-a1b0-ffabcc2c6324",
"buyerUserId": "55144410-a14a-43a1-9e0a-062c6cf31770",
"currency": "USD",
"ownerCompanyId": "b0410709-8333-43e2-84d6-3228f6b9998b",
"ownerUserId": "19d7343b-b8ab-464a-a893-8b107d77137d",
"pricingPlanIds": [
"a12bcf2e-d27e-4808-aae0-6099cc828664",
"3e0a22d3-dafb-4b3d-a487-7f4e7a94b32a"
],
"productIds": [
"100",
"200"
],
"subscriptionIds": [
"915a6558-5a1b-446a-8ec6-334cc60e3d37",
"8569269e-4c7f-4238-807c-513c718be135"
]
}
Example response
{
"branding": {
"desc": "Sample Application description",
"href": "https://marketplace.appdirect.com/api/marketplace/v1/products/1111",
"iconUrl": "https://appdirect.cloudfront.net/app_resources/1111/thumbs_64/img1111.png",
"name": "Sample Application",
"storefrontUrl": "https://marketplace.appdirect.com/apps/1111",
"vendor": "AppDirect"
},
"editions": [
{
"freeTrialTerms": {
"freeTrialDuration": 1,
"freeTrialDurationPeriod": "MONTH",
"freeTrialGracePeriod": 10
},
"id": "45b79e06-1ac6-11e5-90d8-ca7e16f380a7",
"name": "Sample Edition",
"pricingPlans": [
{
"currency": "USD",
"id": "b794c2a1-69a7-40bc-9bf7-75a2f945a5fc",
"pricingPeriod": "MONTHLY",
"pricingSources": [
{
"pricingDefinitions": [
{
"allowsMeteredUsage": true,
"costType": "RECURRING_PER_UNIT",
"costTypeCategory": "RECURRING",
"displaysPricePerIncrement": true,
"increment": 5,
"priceRanges": [
{
"max": 5,
"min": 0,
"salePrice": "4.0000000000",
"wholeSalePrice": null
}
],
"pricingStrategy": "UNIT",
"unit": "USER",
"unitAllowsDecimals": false
}
],
"source": "BASE_CATALOG"
},
{
"pricingDefinitions": [
{
"costType": "ONE_TIME_FLAT",
"costTypeCategory": "ONE_TIME",
"pricingStrategy": "FLAT",
"salePrice": "3.0000000000",
"wholeSalePrice": null
}
],
"source": "CHANNEL_CATALOG"
}
]
}
],
"revenueModel": "RECURRING"
}
],
"id": "098357e5-7a88-45fe-82d3-843bfd6bcbd1",
"stacked": false,
"type": "PRODUCT"
}
POST/v3/checkout/items
Retrieves product details such as branding, pricing, and so on.
Body Parameters
CICheckoutItemsDetailsRequest object:
Property | Type | Description |
---|---|---|
bundleIds | array of string | List of bundle IDs to retrieve details for. (Currently not supported) |
buyerCompanyId | string | The buyer's company's ID. In assisted sales or reseller scenarios, the buyer's company can be different than the owner's company. |
buyerUserId | string | The buyer user ID. The buyer is the person who is making the purchase. In assisted sales or reseller scenarios, the buyer can be different than the owner. |
currency | string | Three-letter code, such as USD, that determines the currency in which to display item pricing details. |
ownerCompanyId | string | The owner's company's ID. |
ownerUserId | string | The owner user ID. The owner owns the product after the purchase is complete. |
pricingPlanIds | array of string | List of pricing plan IDs to retrieve details for. |
productIds | array of string | List of product IDs to retrieve details for. |
subscriptionIds | array of string | List of subscription IDs to retrieve details for. (Currently not supported) |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Item details retrieved successfully | CICheckoutItemDetails |
Companies
Create new company
Example request
curl -X POST https://{marketplaceURL}/api/account/v2/companies \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/account/v2/companies HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"description": "Payload for \"create company\" requests",
"type": "object",
"title": "CreateCompanyV2Request",
"properties": {
"address": {
"allOf": [
{
"type": "object",
"title": "CompanyAddress",
"required": [
"country",
"city",
"zip",
"street1"
],
"properties": {
"city": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"country": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"state": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"street1": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"street2": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"zip": {
"type": "string",
"maxLength": 255,
"minLength": 0
}
},
"example": {
"city": "...",
"country": "...",
"state": "...",
"street1": "...",
"street2": "...",
"zip": "..."
}
},
{
"description": "Company address"
}
]
},
"allowLogin": {
"description": "Optional. Default is \"true\".\n\nWhen set to \"true\", the marketplace company allows users, including the first user, to login to the marketplace and receive emails from the marketplace. Users can purchase and assign products within the company. Products can also be purchased on their behalf, and assigned to them.\n\nWhen set to \"false\", the marketplace company does not allow company members, including the first user, to login to the marketplace or receive email notifications from the marketplace. Products are purchased and assigned on users behalf, and they access those products directly through the product interface.",
"type": "boolean"
},
"billingDayOfMonth": {
"description": "(Optional) Use this property in company creation requests to set the billing cycle start date. The date applies to all purchases made through the specified company, and overrides the marketplace-level billing cycle date.",
"type": "integer"
},
"channelAdmin": {
"description": "Indicates whether the company has Channel Admin access",
"type": "boolean"
},
"companySize": {
"allOf": [
{
"description": "Company size types",
"type": "string",
"title": "CompanySizeType",
"enum": [
"SMALL",
"MEDIUM",
"ENTERPRISE"
]
},
{
"description": "Company size"
}
]
},
"countryCode": {
"description": "Company country code defined by ISO ALPHA-2 standard",
"type": "string"
},
"customAttributes": {
"description": "Custom attributes",
"type": "array",
"items": {
"description": "Custom attributes",
"type": "object",
"title": "CustomAttributeAccountV2Request",
"properties": {
"name": {
"description": "Name",
"type": "string"
},
"value": {
"description": "Value",
"type": "string"
},
"valueKeys": {
"description": "Value keys",
"type": "array",
"items": {
"type": "string"
}
}
},
"example": {
"name": "Company Details",
"valueKeys": [
"great option"
]
}
}
},
"dailyPurchaseLimitExempt": {
"description": "Indicates if company is exempt from the marketplace default daily spend limit",
"type": "boolean"
},
"dailyPurchaseLimitOverrideAmt": {
"description": "Company-level override amount of marketplace default daily spend limit",
"type": "number"
},
"defaultRole": {
"description": "The default role newly created users receive",
"type": "string"
},
"emailAddress": {
"description": "Company email address",
"type": "string"
},
"externalId": {
"description": "Company external ID",
"type": "string"
},
"firstUser": {
"allOf": [
{
"allOf": [
{
"description": "Represents the membership of the first user in a company, who also receives the Company Administrator role by default",
"type": "object",
"title": "CreateCompanyV2RequestFirstUser",
"properties": {
"email": {},
"firstName": {},
"lastName": {},
"position": {},
"roles": {}
},
"example": {
"email": "jude.doe@company8578572384.com",
"firstName": "Jude",
"lastName": "Doe",
"position": "Business Analyst",
"roles": []
}
}
]
},
{
"description": "First user of the newly created company"
}
]
},
"idpUuid": {
"description": "UUID of the identity provider that the user will always use to log in. Contact your AppDirect technical consultant or business consultant to obtain the UUID.",
"type": "string"
},
"importAppsEnabled": {
"description": "The import apps feature is enabled for this company",
"type": "boolean"
},
"industry": {
"description": "Company industry sector",
"type": "string"
},
"name": {
"description": "Company name",
"nullable": true,
"type": "string"
},
"onlyAdminsCanBuy": {
"description": "Indicates if only selected roles in company that can make purchases or all roles in company can make purchases",
"type": "boolean"
},
"phoneNumber": {
"description": "Company phone number",
"nullable": true,
"type": "string"
},
"referral": {
"description": "Indicates whether the company has Referral access",
"type": "boolean"
},
"reseller": {
"description": "Indicates whether the company has Reseller access",
"type": "boolean"
},
"thirtyDaysPurchaseLimitExempt": {
"description": "Indicates if company is exempt from the marketplace default thirty day spend limit",
"type": "boolean"
},
"thirtyDaysPurchaseLimitOverrideAmt": {
"description": "Company-level override amount of marketplace default thirty day spend limit",
"type": "number"
},
"vendor": {
"description": "Indicates whether the company has Vendor access",
"type": "boolean"
},
"website": {
"description": "Company website URL",
"type": "string"
}
},
"example": {
"address": {
"city": "New York",
"country": "US",
"state": "NY",
"street1": "980 West 881st Street",
"street2": "55AB",
"zip": "12345"
},
"channelAdmin": false,
"companySize": "SMALL",
"countryCode": "US",
"customAttributes": [
{
"name": "text_example",
"value": "foo"
},
{
"name": "multiselect_checkboxes_example",
"valueKeys": [
"ipsum",
"fake"
]
}
],
"defaultRole": "USER",
"emailAddress": "info@company12345.com",
"externalId": "P02TSQ3YPZoykqx1a10",
"firstUser": {
"email": "john.smith@company12345.com",
"firstName": "John",
"lastName": "Smith",
"roles": [
"ROLE_SYS_ADMIN"
]
},
"industry": "Sales",
"name": "Company Example",
"phoneNumber": "11234567890",
"reseller": false,
"vendor": false,
"website": "https://www.company12345.com"
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/account/v2/companies', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"address": {
"city": "New York",
"country": "US",
"state": "NY",
"street1": "980 West 881st Street",
"street2": "55AB",
"zip": "12345"
},
"channelAdmin": false,
"companySize": "SMALL",
"countryCode": "US",
"customAttributes": [
{
"name": "text_example",
"value": "foo"
},
{
"name": "multiselect_checkboxes_example",
"valueKeys": [
"ipsum",
"fake"
]
}
],
"defaultRole": "USER",
"emailAddress": "info@company12345.com",
"externalId": "P02TSQ3YPZoykqx1a10",
"firstUser": {
"email": "john.smith@company12345.com",
"firstName": "John",
"lastName": "Smith",
"roles": [
"ROLE_SYS_ADMIN"
]
},
"industry": "Sales",
"name": "Company Example",
"phoneNumber": "11234567890",
"reseller": false,
"vendor": false,
"website": "https://www.company12345.com"
}
Example response
{
"allowLogin": true,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"enabled": true,
"firstUser": {
"email": "john.simpson@company58330881985.com",
"firstName": "John",
"lastName": "Simpson",
"roles": [
"ROLE_USER"
]
},
"links": [
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
"rel": "memberships"
}
],
"name": "Company 7078259907",
"phoneNumber": "9259221234",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": false,
"uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"vendor": false
}
POST/account/v2/companies
Create a new marketplace company
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
Body Parameters
New marketplace company
CreateCompanyV2Request object:
Property | Type | Description |
---|---|---|
address | CompanyAddress | Company address |
allowLogin | boolean | Optional. Default is "true". When set to "true", the marketplace company allows users, including the first user, to login to the marketplace and receive emails from the marketplace. Users can purchase and assign products within the company. Products can also be purchased on their behalf, and assigned to them. When set to "false", the marketplace company does not allow company members, including the first user, to login to the marketplace or receive email notifications from the marketplace. Products are purchased and assigned on users behalf, and they access those products directly through the product interface. |
billingDayOfMonth | integer | (Optional) Use this property in company creation requests to set the billing cycle start date. The date applies to all purchases made through the specified company, and overrides the marketplace-level billing cycle date. |
channelAdmin | boolean | Indicates whether the company has Channel Admin access |
companySize | CompanySizeType | Company size |
countryCode | string | Company country code defined by ISO ALPHA-2 standard |
customAttributes | array of CustomAttributeAccountV2Request | Custom attributes |
dailyPurchaseLimitExempt | boolean | Indicates if company is exempt from the marketplace default daily spend limit |
dailyPurchaseLimitOverrideAmt | number | Company-level override amount of marketplace default daily spend limit |
defaultRole | string | The default role newly created users receive |
emailAddress | string | Company email address |
externalId | string | Company external ID |
firstUser | CreateCompanyV2RequestFirstUser | First user of the newly created company |
idpUuid | string | UUID of the identity provider that the user will always use to log in. Contact your AppDirect technical consultant or business consultant to obtain the UUID. |
importAppsEnabled | boolean | The import apps feature is enabled for this company |
industry | string | Company industry sector |
name | string | Company name |
onlyAdminsCanBuy | boolean | Indicates if only selected roles in company that can make purchases or all roles in company can make purchases |
phoneNumber | string | Company phone number |
referral | boolean | Indicates whether the company has Referral access |
reseller | boolean | Indicates whether the company has Reseller access |
thirtyDaysPurchaseLimitExempt | boolean | Indicates if company is exempt from the marketplace default thirty day spend limit |
thirtyDaysPurchaseLimitOverrideAmt | number | Company-level override amount of marketplace default thirty day spend limit |
vendor | boolean | Indicates whether the company has Vendor access |
website | string | Company website URL |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
201 | Created | Created | CreateCompanyV2Response |
401 | Unauthorized | Unauthorized |
Patch company
Example request
curl -X PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"address": {
"city": "San Francisco",
"country": "United Stated of America",
"state": "California",
"street1": "5th Ave",
"street2": "#400",
"zip": "32455"
},
"channelAdmin": false,
"companySize": "SMALL",
"countryCode": "US",
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"emailAddress": "info@company.com",
"enabled": true,
"externalId": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"industry": "IT",
"name": "Company 7078259907",
"phoneNumber": "9259221234",
"reseller": false,
"vendor": false,
"website": "http://www.company.com"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.patch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.patch 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"address": {
"city": "San Francisco",
"country": "United Stated of America",
"state": "California",
"street1": "5th Ave",
"street2": "#400",
"zip": "32455"
},
"channelAdmin": false,
"companySize": "SMALL",
"countryCode": "US",
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"emailAddress": "info@company.com",
"enabled": true,
"externalId": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"industry": "IT",
"name": "Company 7078259907",
"phoneNumber": "9259221234",
"reseller": false,
"vendor": false,
"website": "http://www.company.com"
}
Example response
{
"address": {
"city": "Calgary",
"country": "Canada",
"state": "AB",
"street1": "Stephen Ave",
"street2": "12",
"zip": "T22V34"
},
"allowLogin": true,
"channelAdmin": true,
"companySize": "SMALL",
"countryCode": "US",
"creationDate": 1457416568000,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"emailAddress": "john.smith@example.com",
"enabled": true,
"externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
"industry": "Finance",
"links": [
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
"rel": "memberships"
}
],
"name": "Company 7078259907",
"phoneNumber": "888-888-8888",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": false,
"salesAgent": {
"href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "salesRepLink"
},
"salesSupport": false,
"uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"vendor": true,
"website": "example.com"
}
PATCH/account/v2/companies/{companyUuid}
Partially update marketplace company account information. This only adds or updates the values for the properties that you include in the call; all other properties are ignored.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Company ID |
Body Parameters
Marketplace company account information and settings
CompanyAccountV2Request object:
Property | Type | Description |
---|---|---|
address | CompanyAddress | Company address |
allowLogin | boolean | Indicates whether a company's users are managed users (false) or not (true). Do not change the value with this request. |
billingDayOfMonth | integer | (Optional) Use this property in company creation requests to set the billing cycle start date. The date applies to all purchases made through the specified company, and overrides the marketplace-level billing cycle date. |
channelAdmin | boolean | Indicates whether the company has Channel Admin access |
companySize | CompanySizeType | Company size |
countryCode | string | Company country code defined by ISO ALPHA-2 standard |
customAttributes | array of CustomAttributeAccountV2 | Custom attributes |
defaultRole | string | The default role newly created users receive |
emailAddress | string | Company email address |
enabled | boolean | Indicates whether company is enabled |
externalId | string | Company external ID |
industry | string | Company industry sector |
name | string | Company name |
phoneNumber | string | Company phone number |
referral | boolean | Indicates whether the company has Referral access |
reseller | boolean | Indicates whether the company has Reseller access |
vendor | boolean | Indicates whether the company has Vendor access |
website | string | Company website URL |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CompanyAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
List all companies
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"address": {
"city": "Calgary",
"country": "Canada",
"state": "AB",
"street1": "Harris Place NW",
"street2": "907",
"zip": "T3B2V4"
},
"channelAdmin": true,
"companySize": "SMALL",
"countryCode": "US",
"creationDate": 1457416568000,
"customAttributes": [],
"defaultRole": "USER",
"emailAddress": "john.smith@example.com",
"enabled": true,
"externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
"industry": "Finance",
"links": [
{
"href": "http://marketplace.local:8080/api/account/v2/companies/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "self"
},
{
"href": "http://marketplace.local:8080/api/account/v2/companies/a3f385be-e10b-444e-99d1-95cd7d4c1f5a/memberships",
"rel": "memberships"
}
],
"name": "John & Co",
"phoneNumber": "888-888-8888",
"picture": null,
"reseller": false,
"salesAgent": {
"href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "salesRepLink"
},
"salesSupport": false,
"uuid": "a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"vendor": true,
"website": "example.com"
},
{
"address": {
"city": "Calgary",
"country": "Canada",
"state": "AB",
"street1": "Harris Place NW",
"street2": "907",
"zip": "T3B2V4"
},
"channelAdmin": true,
"companySize": "SMALL",
"countryCode": "US",
"creationDate": 1521573411000,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "",
"label": "C1593404",
"name": "C1593404",
"value": "t1"
}
],
"defaultRole": "USER",
"emailAddress": "john.smith@example.com",
"enabled": false,
"externalId": "b34974b2-f5d6-4326-9859-5247dc42ee60",
"industry": "Finance",
"links": [
{
"href": "http://marketplace.local:8080/api/account/v2/companies/42f4e0cd-0614-4695-87ba-fcaee49fb995",
"rel": "self"
},
{
"href": "http://marketplace.local:8080/api/account/v2/companies/42f4e0cd-0614-4695-87ba-fcaee49fb995/memberships",
"rel": "memberships"
}
],
"name": "John & Co",
"phoneNumber": "888-888-8888",
"picture": null,
"reseller": false,
"salesAgent": {
"href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "salesRepLink"
},
"salesSupport": false,
"uuid": "42f4e0cd-0614-4695-87ba-fcaee49fb995",
"vendor": true,
"website": "example.com"
}
],
"links": [],
"page": {
"number": 0,
"size": 50,
"totalElements": 2,
"totalPages": 1
}
}
GET/account/v2/companies
Retrieve all marketplace companies.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
custom.customAttributeName | query | string | Accepts a notIn filter in the form of ?custom.customAttributeName=notIn(customAttributeValue1, customAttributeValue2, customAttributeValueN...) that excludes companies with matching values. Before you can use the filter, you must first create "Text" type company custom attributes in the user interface. You can then specify the custom attribute name and values as customAttributeName and customAttributeValueN. See https://help.appdirect.com/platform/Default.htm#MarketplaceManager/MM-Setgscustui-create-attribs.html. | |
includeCustomAttributes | query | boolean | Optional. Default is true. When set to true, company custom attributes are included in the API response. When set to false, company custom attributes are not included. | |
includePurchaseLimitData | query | boolean | Optional. Default is true. When set to true, the purchase limit attributes are fetched, calculated and populated in the response. When set to false, the purchase limit attributes are not fetched. | |
name | query | string | Company name | |
page | query | integer | 0 | Zero-based page index |
size | query | integer | 50 | The number of search results to return per page |
sortField | query | string of enum: NAME |
NAME | The property to sort by |
sortOrder | query | string of enum: ASC DESC |
DESC | Ordering type |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | PagedCompanyAccountV2 |
401 | Unauthorized | Unauthorized |
Read activities
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"actor": {
"activated": false,
"deleted": false,
"email": "c2801919@appdirect.com",
"externalId": null,
"id": 1344,
"name": "C2801919_first last",
"personalInfoMasked": false,
"profileLinkMasked": false,
"roleChanges": null,
"type": "USER",
"userRemovedFromCompanyObject": false,
"userRemovedFromCompanyTarget": false,
"uuid": "966216bb-bb4e-4766-8849-fd72eead20ce"
},
"context": {
"description": "Documentation Center 283",
"header": "Documentation Center 283",
"imageUrl": "https://d33na3ni6eqf5j.cloudfront.net/importable_app_resources/81858cea-627f-45ee-8906-67d5a23dd3bf/list.png?b5960593b97c0fdd95bc9b81c08e70bb"
},
"links": [],
"object": {
"companyLinkMasked": false,
"externalId": null,
"id": 26,
"name": "Company 6032459369",
"type": "COMPANY",
"uuid": "222cf5ff-7795-4ece-b612-83ef6b72bb30"
},
"origin": "MARKETPLACE",
"subject": {
"activated": true,
"deleted": false,
"email": "susan.doe@company5087848592.com",
"externalId": null,
"id": 30,
"name": "Susan Doe",
"personalInfoMasked": false,
"profileLinkMasked": false,
"type": "USER",
"userRemovedFromCompanyObject": false,
"userRemovedFromCompanyTarget": false,
"uuid": "8487f55b-05be-4c0e-97d8-021e5ca4008b"
},
"target": {
"companyLinkMasked": false,
"externalId": null,
"id": 194379,
"name": "Matts Company",
"type": "COMPANY",
"uuid": "a0504b87-f21f-40fe-9de1-e8479776a26f"
},
"timestamp": [
2016,
12,
2,
17,
25,
56,
414
],
"verb": "COMPANY_ACTIVATED"
},
{
"actor": {
"activated": false,
"deleted": false,
"email": "c3945627346@appdirect.com",
"externalId": null,
"id": 1434,
"name": "Adam Smith",
"personalInfoMasked": false,
"profileLinkMasked": false,
"roleChanges": null,
"type": "USER",
"userRemovedFromCompanyObject": false,
"userRemovedFromCompanyTarget": false,
"uuid": "ac6216bb-bb4e-4766-8849-fd72eead20ce"
},
"context": {
"description": "Documentation Center 283",
"header": "Documentation Center 283",
"imageUrl": "https://d33na3ni6eqf5j.cloudfront.net/importable_app_resources/81858cea-627f-45ee-8906-67d5a23dd3bf/list.png?b5960593b97c0fdd95bc9b81c08e70bb"
},
"links": [],
"object": {
"companyLinkMasked": false,
"externalId": null,
"id": 26,
"name": "Company 6032459369",
"type": "COMPANY",
"uuid": "222cf5ff-7795-4ece-b612-83ef6b72bb30"
},
"origin": null,
"subject": {
"activated": true,
"deleted": false,
"email": "susan.doe@company5087848592.com",
"externalId": null,
"id": 30,
"name": "Susan Doe",
"personalInfoMasked": false,
"profileLinkMasked": false,
"type": "USER",
"userRemovedFromCompanyObject": false,
"userRemovedFromCompanyTarget": false,
"uuid": "8487f55b-05be-4c0e-97d8-021e5ca4008b"
},
"target": {
"companyLinkMasked": false,
"externalId": null,
"id": 149379,
"name": "Global Company",
"type": "COMPANY",
"uuid": "70904b87-a2bf-40fe-9de1-e8479776a26f"
},
"timestamp": [
2016,
12,
2,
17,
25,
56,
401
],
"verb": "USER_JOINED"
}
],
"links": [],
"page": {
"number": 0,
"size": 2,
"totalElements": 2,
"totalPages": 1
}
}
GET/account/v2/companies/{companyUuid}/activities
Retrieve company or user activities.
The displayType parameter dictates whether activities for the given user or activities for the whole company are returned.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_USER | Allows access as an end user in the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
displayType | query | string of enum: EVERYONE ONLY_ME |
ONLY_ME | Scope |
page | query | integer | 0 | Zero-based page index |
size | query | integer | 12 | The size of the page to be returned |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | PagedActivityAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Read a company
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"address": {
"city": "Calgary",
"country": "Canada",
"state": "AB",
"street1": "Stephen Ave",
"street2": "12",
"zip": "T22V34"
},
"allowLogin": true,
"channelAdmin": true,
"companySize": "SMALL",
"countryCode": "US",
"creationDate": 1457416568000,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"emailAddress": "john.smith@example.com",
"enabled": true,
"externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
"industry": "Finance",
"links": [
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
"rel": "memberships"
}
],
"name": "Company 7078259907",
"phoneNumber": "888-888-8888",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": false,
"salesAgent": {
"href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "salesRepLink"
},
"salesSupport": false,
"uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"vendor": true,
"website": "example.com"
}
GET/account/v2/companies/{companyUuid}
Retrieve a marketplace company by ID or external ID. If you use the ID, you can omit a prefix or use 'id:' as the prefix. If you use the external ID, you must always specify the 'externalId:' prefix.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_USER | Allows access as an end user in the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier (ID or external ID) of the company in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CompanyAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Update company picture
Example request
curl -X PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"type": "object"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/picture");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"address": {
"city": "Calgary",
"country": "Canada",
"state": "AB",
"street1": "Stephen Ave",
"street2": "12",
"zip": "T22V34"
},
"allowLogin": true,
"channelAdmin": true,
"companySize": "SMALL",
"countryCode": "US",
"creationDate": 1457416568000,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"emailAddress": "john.smith@example.com",
"enabled": true,
"externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
"industry": "Finance",
"links": [
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
"rel": "memberships"
}
],
"name": "Company 7078259907",
"phoneNumber": "888-888-8888",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": false,
"salesAgent": {
"href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "salesRepLink"
},
"salesSupport": false,
"uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"vendor": true,
"website": "example.com"
}
PUT/account/v2/companies/{companyUuid}/picture
Update a marketplace company’s profile picture, for example, with an image of a logo. This method requires a Content-Type request header with a value of “multipart/form-data”. The updated company resource is returned.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request |
Body Parameters
Image file that will be used as the profile picture.
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CompanyAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Update company
Example request
curl -X PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"address": {
"city": "San Francisco",
"country": "United Stated of America",
"state": "California",
"street1": "5th Ave",
"street2": "#400",
"zip": "32455"
},
"channelAdmin": false,
"companySize": "SMALL",
"countryCode": "US",
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"Option 1"
]
}
],
"dailyPurchaseLimit": 1000,
"dailyPurchaseLimitExempt": false,
"dailyPurchaseLimitOverrideAmt": 100,
"dailyPurchaseRemainingAmt": null,
"defaultRole": "USER",
"emailAddress": "info@company.com",
"enabled": true,
"externalId": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"industry": "IT",
"name": "Company 7078259907",
"phoneNumber": "9259221234",
"reseller": false,
"thirtyDaysPurchaseLimit": 0,
"thirtyDaysPurchaseLimitExempt": false,
"thirtyDaysPurchaseLimitOverrideAmt": null,
"thirtyDaysPurchaseRemainingAmt": null,
"vendor": false,
"website": "http://www.company.com"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"address": {
"city": "San Francisco",
"country": "United Stated of America",
"state": "California",
"street1": "5th Ave",
"street2": "#400",
"zip": "32455"
},
"channelAdmin": false,
"companySize": "SMALL",
"countryCode": "US",
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"Option 1"
]
}
],
"dailyPurchaseLimit": 1000,
"dailyPurchaseLimitExempt": false,
"dailyPurchaseLimitOverrideAmt": 100,
"dailyPurchaseRemainingAmt": null,
"defaultRole": "USER",
"emailAddress": "info@company.com",
"enabled": true,
"externalId": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"industry": "IT",
"name": "Company 7078259907",
"phoneNumber": "9259221234",
"reseller": false,
"thirtyDaysPurchaseLimit": 0,
"thirtyDaysPurchaseLimitExempt": false,
"thirtyDaysPurchaseLimitOverrideAmt": null,
"thirtyDaysPurchaseRemainingAmt": null,
"vendor": false,
"website": "http://www.company.com"
}
Example response
{
"address": {
"city": "Calgary",
"country": "Canada",
"state": "AB",
"street1": "Stephen Ave",
"street2": "12",
"zip": "T22V34"
},
"allowLogin": true,
"channelAdmin": true,
"companySize": "SMALL",
"countryCode": "US",
"creationDate": 1457416568000,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"emailAddress": "john.smith@example.com",
"enabled": true,
"externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
"industry": "Finance",
"links": [
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
"rel": "memberships"
}
],
"name": "Company 7078259907",
"phoneNumber": "888-888-8888",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": false,
"salesAgent": {
"href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
"rel": "salesRepLink"
},
"salesSupport": false,
"uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
"vendor": true,
"website": "example.com"
}
PUT/account/v2/companies/{companyUuid}
Update a marketplace company.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Company ID |
Body Parameters
Marketplace company details to be updated
UpdateCompanyAccountV2Request object:
Property | Type | Description |
---|---|---|
address | CompanyAddress | Company address |
allowLogin | boolean | Indicates whether a company's users are managed users (false) or not (true). Do not change the value with this request |
billingDayOfMonth | integer | (Optional) Use this property in company creation requests to set the billing cycle start date. The date applies to all purchases made through the specified company, and overrides the marketplace-level billing cycle date. |
channelAdmin | boolean | Indicates whether the company has Channel Admin access |
companySize | CompanySizeType | Company size |
countryCode | string | Company country code defined by ISO ALPHA-2 standard |
customAttributes | array of CustomAttributeAccountV2 | Custom attributes |
dailyPurchaseLimit | number | Daily spend limit used as the default limit for all companies in the marketplace |
dailyPurchaseLimitExempt | boolean | Whether company is exempt from the marketplace default daily spend limit |
dailyPurchaseLimitOverrideAmt | number | Daily spend limit for this company (overrides marketplace default for daily company spend limit) |
dailyPurchaseRemainingAmt | number | Remaining daily spending amount |
defaultRole | string | The default role newly created users receive |
emailAddress | string | Company email address |
enabled | boolean | Indicates whether company is enabled |
externalId | string | Company external ID |
industry | string | Company industry sector |
name | string | Company name |
phoneNumber | string | Company phone number |
referral | boolean | Indicates whether the company has Referral access |
reseller | boolean | Indicates whether the company has Reseller access |
thirtyDaysPurchaseLimit | number | Monthly spend limit used as the default limit for all companies in the marketplace |
thirtyDaysPurchaseLimitExempt | boolean | Whether company is exempt from the marketplace default thirty-day spend limit |
thirtyDaysPurchaseLimitOverrideAmt | number | Thirty-day spend limit for this company (overrides marketplace default for thirty-day company spend limit) |
thirtyDaysPurchaseRemainingAmt | number | Remaining monthly spending amount |
vendor | boolean | Indicates whether the company has Vendor access |
website | string | Company website URL |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CompanyAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Companies (Reseller)
Company details
Example request
curl -X GET https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}',
method: 'get',
data: '?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}', params={
'context': {
"type": "string",
"enum": [
"RESELLER, RESELLER_MANAGER"
]
}
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}',
params: {
'context' => 'string'
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"actions": [
"JOIN_COMPANY",
"DISABLE_COMPANY",
"MANAGE_CUSTOM_ATTRIBUTES",
"INVITE_USERS"
],
"active": true,
"availableAccesses": [],
"availableRoles": [
"USER"
],
"availableTaxExemptions": [
"FEDERAL_GOVERNMENT_US",
"STATE_GOVERNMENT_US",
"TRIBE_INDIAN",
"FOREIGN_DIPLOMAT",
"CHARITABLE_ORG",
"RELIGIOUS_ORG",
"RESALE",
"COMMERCIAL_AGRICULTURAL",
"INDUSTRIAL_PRODUCTION",
"DIRECT_MAIL_US",
"DIRECT_PAY_PERMIT_US",
"OTHER",
"LOCAL_GOVERNMENT_US",
"COMMERCIAL_AQUACULTURE",
"COMMERCIAL_FISHERY",
"NON_RESIDENT_CAN",
"MEDICAL_DEVICE_WITH_EXEMPT_SALES_TAX_US",
"MEDICAL_DEVICE_WITH_TAXABLE_SALES_TAX_US"
],
"createdOn": 1523007202000,
"defaultRole": "USER",
"enabled": true,
"grantedAccesses": [],
"id": "9e00b38b-7918-4a27-b2f6-123b77cfac0b",
"idpConfigurations": [],
"name": "C37719018",
"settings": [],
"stats": [
{
"children": "0",
"unit": "Free Trials"
},
{
"children": "0",
"unit": "Expired Free Trials"
},
{
"children": "0",
"unit": "Purchased Products"
},
{
"children": "0",
"unit": "Suspended Products"
},
{
"children": "0",
"unit": "Unpaid Invoices"
},
{
"children": "$0.00",
"unit": "Total Spent"
}
]
}
GET/appReseller/v1/companies/{companyId}
Retrieves the current reseller company details.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyId | path | string | Company ID | |
*context | query | string of enum: RESELLER, RESELLER_MANAGER |
Supported AppReseller contexts |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CompanyDetailsWS |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Not found |
List companies
Example request
curl -X GET https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/companies',
method: 'get',
data: '?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/appReseller/v1/companies', params={
'context': {
"type": "string",
"enum": [
"RESELLER, RESELLER_MANAGER"
]
}
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/companies',
params: {
'context' => 'string'
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
[
{
"activated": true,
"createdOn": 1519158286000,
"externalId": "externalRandom",
"grantedAccesses": [],
"id": "386626c0-53e2-4515-8450-4a720bb5d029",
"name": "Test Name",
"numOfUsers": 1,
"phone": "50505055"
},
{
"activated": true,
"createdOn": 1519158286000,
"externalId": "externalRandom2",
"grantedAccesses": [],
"id": "296626c0-53e2-4515-8450-4a720bb5d040",
"name": "Test Name 2",
"numOfUsers": 1,
"phone": "50505056"
}
]
GET/appReseller/v1/companies
Retrieves companies depending on context: in the Reseller context, this endpoint lists all companies linked to the current reseller company; in the Reseller Manager context, it lists all referral and reseller companies in the current marketplace
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_RESELLER | Allows access as a Reseller for the companies |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for the companies |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
active | query | string | User activation status | |
channelAdmin | query | string of enum: ONLY_CHANNEL_ADMINS, ONLY_NON_CHANNEL_ADMINS |
This enum filters companies that have (or not) permission to manage the marketplace. | |
*context | query | string of enum: RESELLER, RESELLER_MANAGER |
Supported AppReseller contexts | |
enabled | query | string | User enablement status | |
fromDate | query | string | From date, in timestamp format | |
page | query | integer | Page number | |
searchText | query | string | Search text | |
size | query | integer | Number of results per page | |
sortField | query | string of enum: COMPANY_ID CREATED_ON |
Field to sort by | |
sortOrder | query | string | Sort order | |
toDate | query | string | To date, in timestamp format | |
vendor | query | string of enum: ONLY_VENDORS, ONLY_NON_VENDORS, ONLY_RESELLERS |
This enum filters companies that can sell (or not) or resell products in the marketplace. |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | array of Company |
401 | Unauthorized | Unauthorized |
Create company
Example request
curl -X POST https://{marketplaceURL}/api/appReseller/v1/companies \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/appReseller/v1/companies HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/companies',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"companyAccess": "RESELLER",
"companySize": "SMALL",
"createdByCompanyId": "386626c0-53e2-4515-8450-4a720bb5d029",
"externalId": "externalRandom",
"name": "Test Name",
"phone": "50505055",
"website": "www.new_company.com"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companies',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/appReseller/v1/companies', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/appReseller/v1/companies',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"companyAccess": "RESELLER",
"companySize": "SMALL",
"createdByCompanyId": "386626c0-53e2-4515-8450-4a720bb5d029",
"externalId": "externalRandom",
"name": "Test Name",
"phone": "50505055",
"website": "www.new_company.com"
}
Example response
{
"createdOn": 1519158286000,
"externalId": "externalRandom",
"id": "386626c0-53e2-4515-8450-4a720bb5d029",
"name": "Test Name",
"phone": "50505055"
}
POST/appReseller/v1/companies
Create a new company linked to the current reseller.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_RESELLER | Allows access as a Reseller for the company. |
Body Parameters
Information about the new company that will be created
AppResellerAccountCompanyCreationRequest object:
Property | Type | Description |
---|---|---|
companyAccess | AppResellerAccountCompanyApiContext | Context |
companySize | AppResellerAccountCompanySize | New company's size |
createdByCompanyId | string | Reseller's company UUID |
externalId | string | External ID used to identify the new company (must be unique) |
name | string | New company's name |
phone | string | New company's phone number |
website | string | New company's website |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | AccountCompanyWS |
401 | Unauthorized | Unauthorized |
List users
Example request
curl -X GET https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/users',
method: 'get',
data: '?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/appReseller/v1/users', params={
'context': {
"type": "string",
"enum": [
"RESELLER",
"RESELLER_MANAGER"
]
}
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/users',
params: {
'context' => 'string'
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"activated": false,
"companyId": "0a357e6b-0000-000a-0000-680eabb9e322",
"createdOn": 1525682872000,
"email": "john@appdirect.com",
"firstName": "John",
"id": "0af398ee-0000-000a-0000-a83d70caeff8",
"invitationRequired": false,
"lastName": "Grande",
"memberships": [
{
"company": {
"createdOn": 1525682872000,
"id": "0a357e6b-0000-000a-0000-680eabb9e322",
"name": "TestCompany"
},
"enabled": true
}
]
},
{
"activated": false,
"companyId": "a5811d92-0000-000a-0000-3c69e47fe126",
"createdOn": 1461321550000,
"email": "george@appdirect.com",
"firstName": "George",
"id": "47e70302-0000-000a-0000-a01cb6129c6c",
"invitationRequired": false,
"lastName": "Common",
"memberships": [
{
"company": {
"createdOn": 1461321550000,
"id": "a5811d92-0000-000a-0000-3c69e47fe126",
"name": "C4027287"
},
"enabled": true
}
]
}
],
"page": {
"number": 0,
"size": 10,
"totalElements": 2,
"totalPages": 1
}
}
GET/appReseller/v1/users
In the Reseller Manager context, this request retrieves all Resellers and Referral users. In the Reseller context, it retrieves all users that belong to companies linked to the reseller.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_RESELLER | Allows access as a Reseller for reading the users from companies that are linked to mine. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for reading the users whose company are Reseller or Referral. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
active | query | string of enum: ONLY_ACTIVE ONLY_INACTIVE ONLY_PENDING_INVITE |
List of user activation status | |
companyId | query | string | User company ID | |
*context | query | string of enum: RESELLER RESELLER_MANAGER |
Supported appReseller contexts | |
fromDate | query | string | From date, in timestamp format | |
page | query | integer | Page number | |
partner | query | string | User partner | |
searchText | query | string | Search text | |
size | query | integer | Number of results per page | |
sortField | query | string of enum: CUSTOMER_ID FIRST_NAME |
Field to sort by | |
sortOrder | query | string | Sort order | |
toDate | query | string | To date, in timestamp format |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserPagedReadResponse |
401 | Unauthorized | Unauthorized |
Create user
Example request
curl -X POST https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/users',
method: 'post',
data: '?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"companyId": "4c00cad1-f741-0zf6-bb00-0000e73cec00",
"createdByCompanyId": "386626c0-53e2-0000-0000-4a720bb5d000",
"email": "user@appdirect.com",
"externalId": "01",
"firstName": "James",
"lastName": "Smith"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/appReseller/v1/users', params={
'context': {
"type": "string",
"enum": [
"RESELLER",
"RESELLER_MANAGER"
]
}
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/appReseller/v1/users',
params: {
'context' => 'string'
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"companyId": "4c00cad1-f741-0zf6-bb00-0000e73cec00",
"createdByCompanyId": "386626c0-53e2-0000-0000-4a720bb5d000",
"email": "user@appdirect.com",
"externalId": "01",
"firstName": "James",
"lastName": "Smith"
}
Example response
{
"companyId": "460fad0d-19e2-4eec-a756-59c15dc7a56a",
"email": "test4@yopmail.com",
"firstName": "user4",
"id": "6d375008-3b19-4cb8-bbb9-dcd9fce99432",
"lastName": "user4",
"memberships": [
{
"company": {
"createdOn": 1525682872000,
"externalId": "external11",
"id": "460fad0d-19e2-4eec-a756-59c15dc7a56a",
"name": "Company3",
"phone": null
}
}
]
}
POST/appReseller/v1/users
Create a new user in a company linked to the Reseller company.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_RESELLER | Allows access as a Reseller for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*context | query | string of enum: RESELLER RESELLER_MANAGER |
Supported appReseller contexts |
Body Parameters
Information about the user to create
UserCreationRequest object:
Property | Type | Description |
---|---|---|
companyId | string | New user's company ID |
createdByCompanyId | string | Reseller's company ID |
string | New user's email (must be unique) |
|
externalId | string | New user's external ID (must be unique) |
firstName | string | New user's First Name |
lastName | string | New user's Last Name |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserCreationResponse |
401 | Unauthorized | Unauthorized | |
500 | Internal Server Error | User not created |
User details
Example request
curl -X GET https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/users/{userId}',
method: 'get',
data: '?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/appReseller/v1/users/{userId}', params={
'context': {
"type": "string",
"enum": [
"RESELLER",
"RESELLER_MANAGER"
]
}, 'companyId': {
"type": "string"
}
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/users/{userId}',
params: {
'context' => 'string',
'companyId' => 'string'
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"actions": [
"SEND_RESET_PASSWORD_EMAIL"
],
"activated": true,
"availableRoles": [
{
"name": "BILLING_ADMIN",
"permission": "READ"
},
{
"name": "SYS_ADMIN",
"permission": "READ"
}
],
"companyId": "c5fe2ca9-3db1-0000-0000-0cf0a01bd437",
"createdOn": 1465984400000,
"customAttributes": [],
"email": "c4201720@appdirect.com",
"enabled": true,
"firstName": "John",
"id": "64535371-9e83-0000-0000-61cb17bc0c9e",
"invitationRequired": false,
"lastName": "Grande",
"memberships": [
{
"company": {
"id": "c5fe2ca9-0000-408c-0000-0cf0a01bd437",
"name": "C4200000"
},
"enabled": true,
"roles": [
"BILLING_ADMIN",
"SYS_ADMIN",
"RESELLER"
]
}
],
"partner": "APPDIRECT",
"settings": [
{
"permission": "READ",
"setting": "SYS_ADMIN",
"value": "true"
},
{
"permission": "READ",
"setting": "BILLING_ADMIN",
"value": "true"
}
]
}
GET/appReseller/v1/users/{userId}
Get a single user details
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyId | query | string | User's company ID (some user details depend on the specified company) | |
*context | query | string of enum: RESELLER RESELLER_MANAGER |
Supported appReseller contexts | |
*userId | path | string | User ID |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserReadResponse |
401 | Unauthorized | Unauthorized |
Company Association
Remove company association
Example request
curl -X DELETE https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
DELETE https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}',
method: 'delete',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}',
{
method: 'DELETE'
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.delete('https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.delete 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
DELETE/appReseller/v1/companyAssociations/{companyAssociationId}
Deletes a company association.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for reading the users whose company are Reseller or Referral. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyAssociationId | path | string | Company Association ID |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
204 | No Content | No Content |
List company associations
Example request
curl -X GET https://{marketplaceURL}/api/appReseller/v1/companyAssociations?resellerCompanyId=type,string&customerCompanyId=type,string \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/appReseller/v1/companyAssociations?resellerCompanyId=type,string&customerCompanyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations',
method: 'get',
data: '?resellerCompanyId=type,string&customerCompanyId=type,string',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companyAssociations?resellerCompanyId=type,string&customerCompanyId=type,string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/appReseller/v1/companyAssociations', params={
'resellerCompanyId': {
"type": "string"
}, 'customerCompanyId': {
"type": "string"
}
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations',
params: {
'resellerCompanyId' => 'string',
'customerCompanyId' => 'string'
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companyAssociations?resellerCompanyId=type,string&customerCompanyId=type,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"createdOn": 1531839782000,
"customerCompany": {
"id": "0dc2860e-0000-40f7-0000-ef0000a30000",
"name": "Customer1"
},
"id": "c39b8bcd-db7a-46d0-939f-facdeb1d6967",
"resellerCompany": {
"id": "0a69093c-0000-4f8d-0000-5e0000630000",
"name": "Reseller1"
}
},
{
"createdOn": 1531839782000,
"customerCompany": {
"id": "0dc2860e-0000-40f7-0000-e0000600000a",
"name": "Customer2"
},
"id": "c39b8bcd-db7a-46d0-939f-facdeb1d6967",
"resellerCompany": {
"id": "0a69093c-0000-4f8d-0000-5000020000ef",
"name": "Reseller2"
}
}
],
"page": {
"number": 0,
"size": 10,
"totalElements": 2,
"totalPages": 1
}
}
GET/appReseller/v1/companyAssociations
Retrieves all customer company associations. This request requires either the Reseller company ID or the Customer company ID, which you can retrieve with the List companies request.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for reading the users whose company are Reseller or Referral. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
createdOn | query | string | Date filter, defined by upper or lower inclusive or exclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; or lte([timestamp]) - 'less than or equal to' | |
*customerCompanyId | query | string | Customer company ID. This field is required if you do not include the Reseller company ID | |
number | query | integer | Page number | |
*resellerCompanyId | query | string | Reseller company ID. This field is required if you do not include the Customer company ID | |
searchText | query | string | Search term used to search on different fields of the customer company association. | |
size | query | integer | Number of results per page | |
sort | query | string | Sort field and order. For ascending sort order, use the '+[FieldName]' format. For descending order, use the '-[FieldName]' format. |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CustomerCompanyAssociationPagedReadResponse |
Create company association
Example request
curl -X POST https://{marketplaceURL}/api/appReseller/v1/companyAssociations \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/appReseller/v1/companyAssociations HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"type": "object",
"title": "CustomerCompanyAssociationCreationRequest",
"required": [
"customerCompanyId",
"resellerCompanyId"
],
"properties": {
"customerCompanyId": {
"description": "Customer company ID",
"type": "string"
},
"resellerCompanyId": {
"description": "Reseller company ID",
"type": "string"
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companyAssociations',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/appReseller/v1/companyAssociations', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companyAssociations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"createdOn": 1531839782000,
"customerCompany": {
"id": "0dc2860e-0000-40f7-0000-ef0000a30000",
"name": "Customer"
},
"id": "c39b8bcd-db7a-46d0-939f-facdeb1d6967",
"resellerCompany": {
"id": "0a69093c-0000-4f8d-0000-5e0000630000",
"name": "Reseller"
}
}
POST/appReseller/v1/companyAssociations
Creates an association (link) between a customer company and a reseller company.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for the marketplace. |
Body Parameters
Information about the association to create
CustomerCompanyAssociationCreationRequest object:
Property | Type | Description |
---|---|---|
customerCompanyId | string | Customer company ID |
resellerCompanyId | string | Reseller company ID |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | CustomerCompanyAssociation |
404 | Not Found | Resource does not exist | |
409 | Conflict | Conflict | CustomerCompanyAssociationConflictResponse |
Company Memberships
Create company membership (Add User)
Example request
curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"description": "Minimal data required to create a active user membership",
"type": "object",
"title": "ActiveUserCreationAccountV2",
"properties": {
"recipientEmails": {
"description": "List of emails where the temporary password is sent",
"type": "array",
"items": {
"type": "string"
}
},
"temporaryPassword": {
"description": "Temporary password",
"type": "string"
},
"user": {
"allOf": [
{
"description": "User information (company)",
"type": "object",
"title": "ActiveUserAccountV2",
"properties": {
"email": {
"description": "Email address",
"type": "string"
},
"firstName": {
"description": "First name",
"type": "string"
},
"lastName": {
"description": "Last name",
"type": "string"
},
"roles": {
"description": "Roles for this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). For user roles (not associated with membership), see [UserAccountV2](#useraccountv2).",
"type": "array",
"items": {
"type": "string"
}
}
},
"example": {
"email": "jude.doe@company8578572384.com",
"firstName": "Jude",
"lastName": "Doe",
"roles": [
"ROLE_USER"
]
}
},
{
"description": "User data"
}
]
}
},
"example": {
"recipientEmails": [
"manager@company9411805586.com",
"itteam@company9411805586.com"
],
"temporaryPassword": "Temporary Password",
"user": {
"email": "guy.smith@company9411805586.com",
"firstName": "Guy",
"lastName": "Smith",
"roles": [
"ROLE_DEVELOPER"
]
}
}
},
{
"example": {
"recipientEmails": [
"manager@company9411805586.com",
"itteam@company9411805586.com"
],
"temporaryPassword": "Temporary Password",
"user": {
"email": "guy.smith@company9411805586.com",
"firstName": "Guy",
"lastName": "Smith",
"roles": [
"ROLE_DEVELOPER"
]
}
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"recipientEmails": [
"manager@company9411805586.com",
"itteam@company9411805586.com"
],
"temporaryPassword": "Temporary Password",
"user": {
"email": "guy.smith@company9411805586.com",
"firstName": "Guy",
"lastName": "Smith",
"roles": [
"ROLE_DEVELOPER"
]
}
}
Example response
{
"company": {
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "USER",
"enabled": true,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1/memberships",
"rel": "memberships"
}
],
"name": "Company 4492834930",
"phoneNumber": "9259221234",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": true,
"uuid": "ece062bd-0c74-4d44-996c-743c3e71f8e1",
"vendor": false
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1/memberships/e16171eb-d89c-4842-9550-2f9cf3ef4cee",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/e16171eb-d89c-4842-9550-2f9cf3ef4cee",
"rel": "user"
},
{
"href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1",
"rel": "company"
}
],
"metadata": {
"mosi_username": null
},
"mosiUser": null,
"position": null,
"roles": [
"ROLE_USER"
],
"user": {
"activated": true,
"allowLogin": true,
"boostUser": null,
"currency": null,
"customAttributes": [],
"email": "guy.smith@company9411805586.com",
"firstName": "Guy",
"lastName": "Smith",
"ldapId": null,
"links": [
{
"href": "http://appdirect/api/account/v2/users/e16171eb-d89c-4842-9550-2f9cf3ef4cee",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/e16171eb-d89c-4842-9550-2f9cf3ef4cee/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": null
},
"picture": null,
"roles": [
"ROLE_USER"
],
"userName": "guy.smith@company9411805586.com",
"uuid": "e16171eb-d89c-4842-9550-2f9cf3ef4cee"
}
}
POST/account/v2/companies/{companyUuid}/memberships/active
Create a marketplace user with membership in the given company.
The created user is active, and is associated with the specified company (membership). User is set with a temporary password; the password is emailed to the recipients specified in the request body.
The domain part of the user's email address must match one of the verified domains associated with the company the user will be created in.
Note: You cannot set the Marketplace Manager role through the API.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request |
Body Parameters
User creation data
ActiveUserCreationAccountV2 object:
Property | Type | Description |
---|---|---|
recipientEmails | array of string | List of emails where the temporary password is sent |
temporaryPassword | string | Temporary password |
user | ActiveUserAccountV2 | User data |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserCompanyMembershipAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Update company membership roles (bulk)
Example request
curl -X PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '[
{
"rolesToAdd": [
"ROLE_DEVELOPER",
"ROLE_RESELLER"
],
"rolesToRemove": [
"ROLE_CHANNEL_SUPPORT"
],
"userUuid": "92a8d9f6-223d-11e8-a232-d879d2b204fc"
},
{
"rolesToAdd": [
"ROLE_SYS_ADMIN"
],
"userUuid": "673d2cda-2d1a-11e8-a232-d879d2b204fc"
}
]';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.patch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.patch 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
[
{
"rolesToAdd": [
"ROLE_DEVELOPER",
"ROLE_RESELLER"
],
"rolesToRemove": [
"ROLE_CHANNEL_SUPPORT"
],
"userUuid": "92a8d9f6-223d-11e8-a232-d879d2b204fc"
},
{
"rolesToAdd": [
"ROLE_SYS_ADMIN"
],
"userUuid": "673d2cda-2d1a-11e8-a232-d879d2b204fc"
}
]
PATCH/account/v2/companies/{companyUuid}/memberships/roles
Update role assignments for one or more company memberships (users).
API clients acting on behalf of an end user must first call Read assignable roles for company membership to retrieve the list of roles they are allowed to update.
Note: You cannot set the Marketplace Manager role through the API.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request |
Body Parameters
User company membership role data
Array of PatchUserCompanyMembershipsAccountV2
Property | Type | Description |
---|---|---|
rolesToAdd | array of string | Roles to add to this membership. One or more of the following: ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). |
rolesToRemove | array of string | Roles to remove from this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). |
userUuid | string | UUID of the user whose membership roles need to be modified |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | |
400 | Bad Request | Bad request | |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Create company membership
Example request
curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"description": "Represents a user membership to a company since a user can be a member of multiple companies ([Companies](#companies))",
"type": "object",
"title": "CreateUserCompanyMembershipAccountV2",
"properties": {
"roles": {
"description": "Optional. When not included the company default role will be used.\n\nRoles for this membership. One or more of the following: ROLE_USER (User), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). For user roles (not associated with membership), see [UserAccountV2](#useraccountv2).",
"type": "array",
"items": {
"type": "string"
}
},
"user": {
"allOf": [
{
"description": "User information data",
"type": "object",
"title": "CreateUserAccountV2",
"properties": {
"allowLogin": {
"description": "Optional. Default is \"true\".\n\nWhen set to \"true\", the user is invited to this marketplace company with login access. The user can purchase and assign products within the company. Products can also be purchased on their behalf, and assigned to them.\n\nWhen set to \"false\", the user is added to this marketplace company without login access. Products are purchased and assigned on their behalf, and they access those products directly through the product interface.\n\nNote: If a user already exists in the marketplace and is being added to an additional company, they must be added with the same login access as their other companies. For example, if a user is currently a member of company A with login access then it's not allowed to add them to company B without login access.",
"type": "boolean"
},
"email": {
"description": "Email address of the user being added to this company. Used to determine if user already exists in the marketplace and invite the user to the company when allowLogin=true.",
"type": "string"
},
"externalId": {
"description": "External identifier of the user",
"type": "string"
},
"firstName": {
"description": "First name of the user being added to this company.",
"type": "string"
},
"idpUuid": {
"description": "UUID of the identity provider that the user will always use to log in. Contact your AppDirect technical consultant or business consultant to obtain the UUID.",
"type": "string"
},
"lastName": {
"description": "Last name of the user being added to this company.",
"nullable": true,
"type": "string"
},
"userName": {
"description": "User name.\nIf not provided, use the user's email address",
"nullable": true,
"type": "string"
}
},
"example": {
"allowLogin": true,
"email": "jude.doe@company8578572384.com",
"externalId": "john.simpson",
"firstName": "Jude",
"idpUuid": "135e3a9f-7f86-46a6-a0af-47a7b3a8936d",
"lastName": "Doe",
"username": "john.simpson"
}
},
{
"description": "User data"
}
]
}
},
"example": {
"roles": [
"ROLE_USER"
],
"user": {
"allowLogin": true,
"email": "jane.lee@company1151609035.com",
"firstName": "Jane",
"lastName": "Lee"
}
}
},
{
"example": {
"roles": [
"ROLE_USER"
],
"user": {
"allowLogin": true,
"email": "mary.gonsalez@company3157614232.com",
"firstName": "Mary",
"lastName": "Gonsalez"
}
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"roles": [
"ROLE_USER"
],
"user": {
"allowLogin": true,
"email": "mary.gonsalez@company3157614232.com",
"firstName": "Mary",
"lastName": "Gonsalez"
}
}
Example response
{
"company": {
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "email",
"name": "Geographic Region",
"value": "US"
}
],
"defaultRole": "DEVELOPER",
"enabled": true,
"links": [
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "self"
},
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships",
"rel": "memberships"
}
],
"name": "Appdirect",
"phoneNumber": "9259221234",
"picture": null,
"reseller": true,
"uuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"vendor": true
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships/29c370c8-960a-43a0-8dc5-c09aadbaa101",
"rel": "self"
},
{
"href": "http://localhost:8080/api/account/v2/users/29c370c8-960a-43a0-8dc5-c09aadbaa101",
"rel": "user"
},
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
}
],
"metadata": {
"mosi_username": null
},
"mosiUser": null,
"position": null,
"roles": [
"ROLE_DEVELOPER"
],
"user": {
"activated": false,
"allowLogin": true,
"boostUser": null,
"currency": null,
"customAttributes": [],
"email": "mary.gonsalez@company3157614232.com",
"firstName": "Mary",
"lastName": "Gonsalez",
"ldapId": null,
"links": [
{
"href": "http://localhost:8080/api/account/v2/users/29c370c8-960a-43a0-8dc5-c09aadbaa101",
"rel": "self"
},
{
"href": "http://localhost:8080/api/account/v2/users/29c370c8-960a-43a0-8dc5-c09aadbaa101/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": null
},
"picture": null,
"roles": [
"ROLE_USER"
],
"userName": "mary.gonsalez@company3157614232.com",
"uuid": "29c370c8-960a-43a0-8dc5-c09aadbaa101"
}
}
POST/account/v2/companies/{companyUuid}/memberships
Add a new or existing user as a member of a marketplace company.
If no user exists with the given email address a new user account (Users) will be created. Use the allowLogin body parameter to control if a new user account should be invited to the marketplace with login access or created as a managed user without login access. See CreateUserAccountV2 for more information on the allowLogin parameter.
Depending on channel configuration, an invited membership is either created immediately, or when the invited user accepts the invitation.
Note: You cannot set the Marketplace Manager role through the API.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
inviterUuid | query | string | Unique identifier of the inviter in the API request. Required only when ROLE_PARTNER authority/scope is used to make the API request. |
Body Parameters
User company membership data
CreateUserCompanyMembershipAccountV2 object:
Property | Type | Description |
---|---|---|
roles | array of string | Optional. When not included the company default role will be used. Roles for this membership. One or more of the following: ROLE_USER (User), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). For user roles (not associated with membership), see UserAccountV2. |
user | CreateUserAccountV2 | User data |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
201 | Created | Success | UserCompanyMembershipAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/Inviter not found |
Delete company membership
Example request
curl -X DELETE https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
DELETE https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
method: 'delete',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
method: 'DELETE'
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.delete('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.delete 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
DELETE/account/v2/companies/{companyUuid}/memberships/{userUuid}
Delete a marketplace user's company membership.
If this is the only company the user was member of, user is marked as deleted. A user that has active entitlements, owns products or is externally managed can't be deleted.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
204 | No Content | Success | |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User/Membership not found |
Invite a managed user
Example request
curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite',
{
method: 'POST'
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
POST/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite
Invite a managed user as a member of a marketplace company. If the user is a member of a managed company, the managed company identifier must be used in this request. The operation will then also convert the managed company to a regular company.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
inviterUuid | query | string | Unique identifier of the inviter in the API request. Required only when ROLE_PARTNER authority/scope is used to make the API request. | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
204 | No Content | Success | |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/ManagedUser/Inviter not found |
Enable/Disable company membership
Example request
curl -X PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"description": "Represents partially updating a user membership to company",
"type": "object",
"title": "PatchUserCompanyMembershipAccountV2",
"properties": {
"enabled": {
"description": "Indicates whether membership is enabled",
"type": "boolean"
}
},
"example": {
"enabled": true
}
},
{
"example": {
"enabled": true
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.patch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.patch 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"enabled": true
}
Example response
{
"company": {
"defaultRole": "USER",
"enabled": true,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7/memberships",
"rel": "memberships"
}
],
"name": "Company 1079194187",
"phoneNumber": "9259221234",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"uuid": "88542fbc-f801-4588-9525-e615146889f7",
"vendor": false
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7/memberships/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd",
"rel": "user"
},
{
"href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7",
"rel": "company"
}
],
"metadata": {
"mosi_username": null
},
"mosiUser": null,
"position": null,
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_SYS_ADMIN"
],
"user": {
"activated": true,
"allowLogin": true,
"boostUser": null,
"email": "susan.gonsalez@company4486527851.com",
"firstName": "Susan",
"lastName": "Gonsalez",
"ldapId": null,
"links": [
{
"href": "http://appdirect/api/account/v2/users/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": null
},
"picture": null,
"roles": [
"ROLE_USER"
],
"userName": "susan.gonsalez",
"uuid": "9cc60e5e-5a46-4efb-9d53-afc6ee0586cd"
}
}
PATCH/account/v2/companies/{companyUuid}/memberships/{userUuid}
Enable or disable marketplace user's company membership.
This only changes the user company membership's enabled status; all other attributes are ignored.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | Unique identifier of user in the API request |
Body Parameters
User company membership data
PatchUserCompanyMembershipAccountV2 object:
Property | Type | Description |
---|---|---|
enabled | boolean | Indicates whether membership is enabled |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserCompanyMembershipAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User/Membership not found |
Read assignable roles for company membership
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
[
{
"name": "USER"
},
{
"name": "CHANNEL_PRODUCT_SUPPORT"
},
{
"name": "SALES_SUPPORT"
},
{
"name": "CHANNEL_SUPPORT"
}
]
GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles
Retrieve marketplace roles that can be assigned by this company membership.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
ROLE_USER | Allows access as current user matches the user in path. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | array of UserRoleAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User/Membership not found |
Read company membership
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"company": {
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "DEVELOPER",
"enabled": true,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships",
"rel": "memberships"
}
],
"name": "Company 5261852235",
"phoneNumber": "9259221234",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": true,
"uuid": "4be3ce24-a702-46b9-a789-f15ce822a9ef",
"vendor": true
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships/6de203c1-a583-455a-ba95-3797edc262d0",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
"rel": "user"
},
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
"rel": "company"
}
],
"metadata": {
"mosi_username": "adazuretest@sdasd21321.onmicrosoft.com"
},
"mosiUser": {
"username": "adazuretest@sdasd21321.onmicrosoft.com"
},
"position": "Business Analyst",
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_SYS_ADMIN"
],
"user": {
"activated": true,
"allowLogin": true,
"boostUser": {
"apsUid": "murnu8w"
},
"currency": null,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "commission_hint",
"label": "Commission_Payout_ID",
"name": "C5125859",
"value": "value"
}
],
"email": "jude.simpson@company5833088198.com",
"firstName": "Jude",
"lastName": "Simpson",
"ldapId": "1",
"links": [
{
"href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": "murnu8w"
},
"picture": "http://appdirect/profilePics/img2147417701652580695.png?184b58e358f087154d94329f9000b28a",
"roles": [
"ROLE_USER"
],
"userName": "jude.simpson",
"uuid": "6de203c1-a583-455a-ba95-3797edc262d0"
}
}
GET/account/v2/companies/{companyUuid}/memberships/{userUuid}
Retrieve a marketplace user's company membership information.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_RESELLER_MANAGER | Allows access as a Reseller Manager for the marketplace. Only memberships with the Reseller role or that are linked to Reseller companies can be retrieved. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_USER | Allows access as an end user in the company |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
includeCompanies | query | boolean | Optional. Default is true. When set to true, companies will be included in the API response. When set to false, companies will not be included. | |
includeUserCustomAttributes | query | boolean | Optional. Default is true. When set to true, user custom attributes will be included in the API response. When set to false, user custom attributes will not be included. | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserCompanyMembershipAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User/Membership not found |
List company memberships
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"company": {
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "DEVELOPER",
"enabled": true,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships",
"rel": "memberships"
}
],
"name": "Company 5261852235",
"phoneNumber": "9259221234",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": true,
"uuid": "4be3ce24-a702-46b9-a789-f15ce822a9ef",
"vendor": true
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
"rel": "user"
},
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
"rel": "company"
}
],
"metadata": {
"mosi_username": "agcompanybill1@testl3816.onmicrosoft.com"
},
"mosiUser": {
"username": "agcompanybill1@testl3816.onmicrosoft.com"
},
"position": "Project Team Lead",
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_SYS_ADMIN"
],
"user": {
"activated": true,
"allowLogin": true,
"boostUser": {
"apsUid": "murnu8w"
},
"currency": null,
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "commission_hint",
"label": "Commission_Payout_ID",
"name": "C5125859",
"value": "value"
}
],
"email": "john.simpson@company58330881982.com",
"firstName": "John",
"lastName": "Simpson",
"ldapId": "1",
"links": [
{
"href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": "murnu8w"
},
"picture": "http://appdirect/profilePics/img2147417701652580695.png?184b58e358f087154d94329f9000b28a",
"roles": [
"ROLE_USER"
],
"userName": "john.simpson",
"uuid": "d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0"
}
},
{
"company": {
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "Geographic Region",
"name": "Geographic Region",
"value": "US"
},
{
"attributeType": "MULTISELECT",
"hint": "",
"label": "Label Names",
"name": "Company Details",
"valueKeys": [
"great option"
]
}
],
"defaultRole": "DEVELOPER",
"enabled": true,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships",
"rel": "memberships"
}
],
"name": "Company 5261852235",
"phoneNumber": "9259221234",
"picture": "http://localhost:8080/profilePics/http://cdn/company.png",
"reseller": true,
"uuid": "4be3ce24-a702-46b9-a789-f15ce822a9ef",
"vendor": true
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships/6de203c1-a583-455a-ba95-3797edc262d0",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
"rel": "user"
},
{
"href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
"rel": "company"
}
],
"metadata": {
"mosi_username": "adazuretest@sdasd21321.onmicrosoft.com"
},
"mosiUser": {
"username": "adazuretest@sdasd21321.onmicrosoft.com"
},
"position": "Business Analyst",
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_SYS_ADMIN"
],
"user": {
"activated": true,
"allowLogin": true,
"boostUser": null,
"currency": null,
"customAttributes": [],
"email": "jude.simpson@company5833088198.com",
"firstName": "Jude",
"lastName": "Simpson",
"ldapId": null,
"links": [
{
"href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": null
},
"picture": null,
"roles": [
"ROLE_USER"
],
"userName": "jude.simpson",
"uuid": "6de203c1-a583-455a-ba95-3797edc262d0"
}
}
],
"links": [],
"page": {
"number": 0,
"size": 50,
"totalElements": 2,
"totalPages": 1
}
}
GET/account/v2/companies/{companyUuid}/memberships
List a marketplace company's user memberships.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_USER | Allows access as an end user in the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
active | query | boolean | If specified, returns only memberships associated with users having the specified active status | |
*companyUuid | path | string | Unique identifier of company in the API request | |
enabled | query | boolean | If specified, returns only memberships with the specified enabled status | |
groupUuid | query | string | If specified, returns only memberships that are a part of the specified group | |
includeCompanies | query | boolean | Optional. Default is true. When set to true, companies will be included in the API response. When set to false, companies will not be included. | |
includeUserCustomAttributes | query | boolean | Optional. Default is true. When set to true, user custom attributes will be included in the API response. When set to false, user custom attributes will not be included. | |
page | query | integer | 0 | Zero-based page index |
roleName | query | string | If specified, returns only memberships with the specified role enabled | |
searchText | query | string | Search term used to search on different fields of a membership | |
size | query | integer | 50 | The size of the page to be returned |
sortField | query | string of enum: DATE FIRST_NAME LAST_NAME |
DATE | The property to sort by |
sortOrder | query | string of enum: ASC DESC |
ASC | Ordering type |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | PagedUserCompanyMembershipAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
List application assignments for company membership
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"assignmentCount": 1,
"companyEntitlementId": 23,
"companyEntitlementLabel": "Mock App",
"companyEntitlementStatus": "ACTIVE",
"createdOn": 1480699562586,
"gridImageUrl": "http://appdirect/app_resources/9/myAppIcon/img1445094381431796823.png?466c707fefd0aba59d170d532e013f3d",
"links": [
{
"href": "http://appdirect/api/marketplace/v1/products/47",
"rel": "application"
}
],
"listImageUrl": "http://appdirect/app_resources/9/thumbs_64/img1445094381431796823.png?466c707fefd0aba59d170d532e013f3d",
"ownerFirstName": "Susan",
"ownerId": 40,
"ownerLastName": "Simpson",
"ownerUuid": "4aad1f87-a653-4031-9b64-de42c7c5fa3f",
"productName": "MockApp208301774438095187",
"status": "ACTIVE",
"uuid": "4d8ab391-33b9-472f-abce-6a6bd5e4c39b"
},
{
"assignmentCount": 2,
"companyEntitlementId": 1323,
"companyEntitlementLabel": "Sample App",
"companyEntitlementStatus": "ACTIVE",
"createdOn": 1481650330000,
"gridImageUrl": "http://appdirect/app_resources/2723/myAppIcon/img4627488903781521711.png?0e3706dc6af5012131ca53ed107d0675",
"links": [
{
"href": "http://appdirect/api/marketplace/v1/products/2723?country=¤cy=",
"rel": "application"
}
],
"listImageUrl": "http://appdirect/app_resources/2723/thumbs_64/img4627488903781521711.png?5eee537065a26ca7f488610144784c88\n",
"ownerFirstName": "super",
"ownerId": 1,
"ownerLastName": "user",
"ownerUuid": "2f93cb24-f7b9-433f-875e-bb0dd9b0f1c1",
"productName": "Sample Application2",
"status": "ACTIVE",
"uuid": "88ab5014-56fa-4e4e-9090-8ac6e4e2d189"
}
],
"links": []
}
GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments
Retrieve a marketplace user's application assignments.
Returns assignments that are not FAILED or CANCELLED.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | ResourcesUserAssignmentAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User not found |
Read user checklist
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"haveAssignedUsers": false,
"haveCompletedCompanyProfile": false,
"haveCompletedProfile": false,
"haveInvitedUsers": false,
"havePurchasedProduct": false,
"links": []
}
GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist
Retrieve a marketplace user's checklist.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
ROLE_USER | Allows access as current user matches the user in path. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserChecklistAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User not found |
Request to purchase an application
Example request
curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests',
{
method: 'POST'
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
POST/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests
Request to purchase an application for the given marketplace company and user.
This causes an email notification to be sent to company administrators (system and billing admins).
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_USER | Allows access as current user matches the user in path. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*applicationId | path | integer | Unique identifier of application to purchase | |
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | User Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
204 | No Content | Success | |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User/Membership/Application not found | |
409 | Conflict | Application already purchased |
Update company membership
Example request
curl -X PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
method: 'put',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"description": "Represents updating a user membership to company",
"type": "object",
"title": "UpdateUserCompanyMembershipAccountV2",
"properties": {
"enabled": {
"description": "Indicates whether the membership is enabled",
"type": "boolean"
},
"roles": {
"description": "Roles for this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer).",
"type": "array",
"items": {
"type": "string"
}
}
},
"example": {
"enabled": true,
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_DEVELOPER",
"ROLE_SYS_ADMIN"
]
}
},
{
"example": {
"enabled": true,
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_DEVELOPER",
"ROLE_SYS_ADMIN"
]
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"enabled": true,
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_DEVELOPER",
"ROLE_SYS_ADMIN"
]
}
Example response
{
"company": {
"customAttributes": [
{
"attributeType": "TEXT",
"hint": "US West, US Central, or US East",
"label": "email",
"name": "Geographic Region",
"value": "US1"
}
],
"defaultRole": "DEVELOPER",
"enabled": true,
"links": [
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "self"
},
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships",
"rel": "memberships"
}
],
"name": "Appdirect",
"phoneNumber": "9259221234",
"picture": null,
"reseller": true,
"uuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"vendor": true
},
"enabled": true,
"lastUsed": false,
"links": [
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships/a38ef2d2-cdad-483c-ba86-fa6186d12263",
"rel": "self"
},
{
"href": "http://localhost:8080/api/account/v2/users/a38ef2d2-cdad-483c-ba86-fa6186d12263",
"rel": "user"
},
{
"href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
}
],
"metadata": {
"mosi_username": null
},
"mosiUser": null,
"position": null,
"roles": [
"ROLE_BILLING_ADMIN",
"ROLE_DEVELOPER",
"ROLE_SYS_ADMIN",
"ROLE_CHANNEL_ADMIN",
"ROLE_CHANNEL_PRODUCT_SUPPORT",
"ROLE_CHANNEL_SUPPORT",
"ROLE_SALES_SUPPORT",
"ROLE_RESELLER",
"ROLE_RESELLER_MANAGER"
],
"user": {
"activated": true,
"allowLogin": true,
"boostUser": {
"apsUid": "murnu8w"
},
"currency": null,
"customAttributes": [],
"email": "guy.smith24@yopmail.com",
"firstName": "Guy",
"lastName": "Smith",
"ldapId": null,
"links": [
{
"href": "http://localhost:8080/api/account/v2/users/a38ef2d2-cdad-483c-ba86-fa6186d12263",
"rel": "self"
},
{
"href": "http://localhost:8080/api/account/v2/users/a38ef2d2-cdad-483c-ba86-fa6186d12263/memberships",
"rel": "memberships"
}
],
"metadata": {
"apsUid": "murnu8w"
},
"picture": null,
"roles": [
"ROLE_USER"
],
"userName": "guy.smith24@yopmail.com",
"uuid": "a38ef2d2-cdad-483c-ba86-fa6186d12263"
}
}
PUT/account/v2/companies/{companyUuid}/memberships/{userUuid}
Update a marketplace user's company membership.
Updates the following roles based on the provided user company membership data: Product Support, Sales Support, Reseller Manager, Customer Support, Reseller, Billing Admin, Company Admin, Developer. This also enables/disables the membership based on provided user company membership data.
Note: You cannot set the Marketplace Manager role through the API.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER | Allows access to read and write all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
*userUuid | path | string | Unique identifier of user in the API request |
Body Parameters
Update User company membership data
UpdateUserCompanyMembershipAccountV2 object:
Property | Type | Description |
---|---|---|
enabled | boolean | Indicates whether the membership is enabled |
roles | array of string | Roles for this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | UserCompanyMembershipAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User/Membership not found |
List groups for company membership
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "superuser group",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/56ac8abc-2b63-4b66-a648-dde419aa6c4a",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/56ac8abc-2b63-4b66-a648-dde419aa6c4a/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 2,
"name": "superuser-group",
"systemManaged": false,
"uuid": "56ac8abc-2b63-4b66-a648-dde419aa6c4a"
},
{
"companyDefault": true,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All company users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/5acdd82e-5cb7-4a23-b842-38d514aafcdf",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/5acdd82e-5cb7-4a23-b842-38d514aafcdf/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 88,
"name": "Everyone",
"systemManaged": true,
"uuid": "5acdd82e-5cb7-4a23-b842-38d514aafcdf"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Company Admin users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/74f7132f-8dd9-4b3a-8014-5aac81dc2c05",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/74f7132f-8dd9-4b3a-8014-5aac81dc2c05/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 14,
"name": "Company Admins",
"systemManaged": true,
"uuid": "74f7132f-8dd9-4b3a-8014-5aac81dc2c05"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Marketplace Managers",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/9a79c98d-8e36-49ed-837c-cc9473dee851",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/9a79c98d-8e36-49ed-837c-cc9473dee851/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 9,
"name": "Marketplace Managers",
"systemManaged": true,
"uuid": "9a79c98d-8e36-49ed-837c-cc9473dee851"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Reseller Manager users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/6d970a9e-a702-406f-808b-9483163efdd1",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/6d970a9e-a702-406f-808b-9483163efdd1/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 2,
"name": "Reseller Managers",
"systemManaged": true,
"uuid": "6d970a9e-a702-406f-808b-9483163efdd1"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Customer Support users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/70c65cb0-cbe5-447c-bdce-1d00e4d08f84",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/70c65cb0-cbe5-447c-bdce-1d00e4d08f84/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 12,
"name": "Customer Support",
"systemManaged": true,
"uuid": "70c65cb0-cbe5-447c-bdce-1d00e4d08f84"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Sales Support users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/73f252d5-0dbe-4414-8384-edb7544b83b6",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/73f252d5-0dbe-4414-8384-edb7544b83b6/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 13,
"name": "Sales Support",
"systemManaged": true,
"uuid": "73f252d5-0dbe-4414-8384-edb7544b83b6"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Product Support users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/b0cf07b9-9953-406f-ba64-b4ca239f30bf",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/b0cf07b9-9953-406f-ba64-b4ca239f30bf/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 12,
"name": "Product Support",
"systemManaged": true,
"uuid": "b0cf07b9-9953-406f-ba64-b4ca239f30bf"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Developer users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/a7d34c49-a376-433b-af53-f51be1cf2038",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/a7d34c49-a376-433b-af53-f51be1cf2038/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 78,
"name": "Developers",
"systemManaged": true,
"uuid": "a7d34c49-a376-433b-af53-f51be1cf2038"
},
{
"companyDefault": false,
"companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
"description": "All Billing Admin users",
"externallyManaged": false,
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/84d6c781-9290-461c-a18f-010791cb87ca",
"rel": "self"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
"rel": "company"
},
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/84d6c781-9290-461c-a18f-010791cb87ca/memberships?member=true&page=0&size=50",
"rel": "memberships"
}
],
"memberCount": 20,
"name": "Billing Admins",
"systemManaged": true,
"uuid": "84d6c781-9290-461c-a18f-010791cb87ca"
}
],
"links": [
{
"href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships/2f93cb24-f7b9-433f-875e-bb0dd9b0f1c1/groups?page=0&size=50&sortField=createdOn&sortOrder=DESC",
"rel": "self"
}
],
"page": {
"number": 0,
"size": 50,
"totalElements": 10,
"totalPages": 1
}
}
GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups
Retrieve the list of groups the company membership is in.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_PARTNER_READ | Allows access to read all marketplace data. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_USER | Allows access as an end user in the company |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of company in the API request | |
ldap | query | boolean | Set to true when company is externally managed | |
page | query | integer | 0 | Zero-based page index |
searchText | query | string | Search term used to search on group name and description | |
size | query | integer | 50 | The size of the page to be returned |
sortField | query | string | createdOn | |
sortOrder | query | string of enum: ASC DESC |
DESC | |
*userUuid | path | string | Unique identifier of user in the API request |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | PagedCompanyGroupAccountV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company/User not found |
Read company assignable roles
Example request
curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/assignableRoles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
[
{
"name": "ROLE_SYS_ADMIN"
},
{
"name": "ROLE_RESELLER"
},
{
"name": "ROLE_BILLING_ADMIN"
},
{
"name": "ROLE_USER"
}
]
GET/account/v2/companies/{companyUuid}/assignableRoles
Retrieves a list of marketplace roles that the current, logged-in user can assign to any user in any marketplace company.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_CHANNEL_ADMIN | Allows access as a Marketplace Manager for the marketplace. |
ROLE_CHANNEL_SUPPORT | Allows access as a Customer Support agent for the marketplace. |
ROLE_CORPORATE_ADMIN | Allows access as a Network Manager for the marketplace. |
ROLE_RESELLER | Allows access as a Reseller for the company. |
ROLE_SALES_SUPPORT | Allows access as a Sales Support agent for the marketplace. |
ROLE_SYS_ADMIN | Allows access as a Company Admin for the company. |
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*companyUuid | path | string | Unique identifier of the company |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | array of UserAssignableRoleV2 |
401 | Unauthorized | Unauthorized | |
404 | Not Found | Company not found |
Content Events
Publish content events
Example request
curl -X POST https://{marketplaceURL}/api/appwise/v2/data \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/appwise/v2/data HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/appwise/v2/data',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"description": "Descriptions of content change events, and the associated content",
"type": "object",
"title": "ContentEvent",
"required": [
"key"
],
"properties": {
"action": {
"allOf": [
{
"description": "An action statement that can be used to describe changes that appear in feeds. The statement is constructed of a verb suffixed by text. For example: Verb (assigned) + text (a task) = action description (assigned a task). If delete boolean is true, the resource is deleted from Customer Search.\n\nRequired parameters: Only Text and Verb are required in requests to create action statements. Only delete is required to delete a resource.",
"type": "object",
"title": "Action",
"required": [
"text",
"verb"
],
"properties": {
"delete": {
"description": "If true, the resource is deleted from Search",
"type": "boolean"
},
"text": {
"description": "The text that appears after the verb in the (verb+text) action statement",
"type": "string"
},
"verb": {
"description": "The verb that appears in the (verb+text) action statement",
"type": "string"
}
},
"example": {
"text": "a task",
"verb": "assigned"
}
},
{
"description": "Description of changes in the event"
}
]
},
"actor": {
"allOf": [
{
"description": "Identify the application user by identifier (accountName) and name.\n\nRequired parameters: Only identifier is required to identify a user.",
"type": "object",
"title": "ContentEventActor",
"required": [
"identifier"
],
"properties": {
"identifier": {
"description": "Identifier (accountName) for the application user. Format: {user_handle}@{user_uuid}@{company_uuid}. Required.",
"type": "string",
"example": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4"
},
"name": {
"description": "Full name of the user in the application",
"type": "string",
"example": "Bob Roberts"
}
},
"example": {
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
}
},
{
"description": "The user (accountName) who made the change. There is no actor for system-generated changes."
}
]
},
"changes": {
"allOf": [
{
"description": "Changes to a resource connected to Search",
"type": "object",
"title": "Changes",
"properties": {
"fields": {
"description": "Field changes",
"type": "array",
"items": {
"description": "Defines a field, valid content, appearance, and behavior",
"type": "object",
"title": "ContentEventField",
"required": [],
"properties": {},
"example": {}
}
},
"groups": {
"description": "Group access changes",
"type": "array",
"items": {
"description": "UUID of a user group configured in the marketplace. Gives resource visibility to a group of users.",
"type": "object",
"title": "Group",
"required": [],
"properties": {},
"example": {}
}
},
"users": {
"description": "User access changes",
"type": "array",
"items": {
"description": "The application user by identifier (accountName) and name. If delete boolean is true, the user's application account (accountName) for the Search resource is deleted from the ContentEventUser users array.\n\nRequired parameters: Only identifier is required to identify a user. Identifier and delete are required for deletion.",
"type": "object",
"title": "ContentEventUser",
"required": [],
"properties": {},
"example": {}
}
}
},
"example": {
"fields": [
{
"display": "expanded",
"label": "Project Status",
"name": "projectStatus",
"op": "replace",
"value": "In progress"
}
],
"groups": [
{
"identifier": "c390a4bf-4f54-418a-87ca-5970c332ba17"
}
],
"users": [
{
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
}
]
}
},
{
"description": "List of field and user access changes to apply to the resource. This field must not be provided if the resource is being deleted (\"action.delete\": true)."
}
]
},
"contents": {
"description": "Content items associated with the resource",
"type": "array",
"items": {
"description": "Structured Search content. When delete parameter is true, the content is removed from the resource.",
"type": "object",
"title": "Content",
"required": [
"url"
],
"properties": {
"delete": {
"description": "If true, the content is removed from the resource",
"type": "boolean"
},
"linkedToResource": {
"description": "Manage duplicate search results for content associated with other resources. If true, link content to associated resources and return it as a single object. If false, content and associated resources are returned as separate objects. Example: Search terms appear in a spreadsheet that is attached to an email. If true, search returns the spreadsheet. If false, search returns the email and the spreadsheet.",
"type": "boolean"
},
"mimeType": {
"description": "MIME type of the content",
"type": "string",
"example": "application/pdf"
},
"previewUrl": {
"description": "URL of the content preview",
"type": "string",
"example": "https://myapp.com/orders/1234?preview"
},
"searchText": {
"description": "Full text of the content",
"type": "string"
},
"title": {
"description": "Title of the content",
"type": "string",
"example": "Order request"
},
"url": {
"description": "URL of the content. Required.",
"type": "string",
"example": "https://myapp.com/orders/1234"
}
},
"example": {
"linkedToResource": true,
"mimeType": "application/pdf",
"previewUrl": "https://myapp.com/orders/1234?preview",
"searchText": "string",
"title": "Order request",
"url": "https://myapp.com/orders/1234"
}
}
},
"eventMetadata": {
"allOf": [
{
"description": "Metadata for Search content",
"type": "object",
"title": "EventMetadata",
"required": [
"id",
"timestamp",
"type"
],
"properties": {
"id": {
"description": "Event ID. Required.",
"type": "string"
},
"timestamp": {
"description": "Event timestamp. Required.",
"type": "string"
},
"type": {
"allOf": [
{},
{}
]
}
},
"example": {
"id": "6ed0279c-35ed-4c7e-928e-25e46c080431",
"timestamp": "2020-06-11T15:23:45Z",
"type": "ResourceUpdated"
}
},
{
"description": "Metadata associated with the event"
}
]
},
"key": {
"allOf": [
{
"description": "Identify a resource",
"type": "object",
"title": "Key",
"required": [
"instance",
"resourceId",
"source"
],
"properties": {
"instance": {
"description": "Vendor account identifier within the application. Required.",
"type": "string"
},
"resourceId": {
"description": "Unique ID of the resource in the instance. Required.",
"type": "string"
},
"source": {
"description": "Application UUID. Note: Application UUID = Product UUID. Required.",
"type": "string"
},
"timestamp": {
"description": "UTC timestamp of when the event occurred in epoch format, with millisecond precision",
"type": "integer",
"format": "int64"
}
},
"example": {
"instance": "myclient.myapp.com",
"resourceId": "order-12345",
"source": "b2fc6737-3d3f-4da2-afda-f80f25b89af9",
"timestamp": 1500558736123
}
},
{
"description": "Event key. Required."
}
]
}
},
"example": {
"action": {
"text": "a task",
"verb": "assigned"
},
"actor": {
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
},
"changes": {
"fields": [
{
"display": "expanded",
"label": "Project Status",
"name": "projectStatus",
"op": "replace",
"value": "In progress"
}
],
"groups": [
{
"identifier": "c390a4bf-4f54-418a-87ca-5970c332ba17"
}
],
"users": [
{
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
}
]
},
"contents": [
{
"linkedToResource": true,
"mimeType": "application/pdf",
"previewUrl": "https://myapp.com/orders/1234?preview",
"searchText": "string",
"title": "Order request",
"url": "https://myapp.com/orders/1234"
}
],
"eventMetadata": {
"id": "6ed0279c-35ed-4c7e-928e-25e46c080431",
"timestamp": "2020-06-11T15:23:45Z",
"type": "ResourceUpdated"
},
"key": {
"instance": "myclient.myapp.com",
"resourceId": "order-12345",
"source": "b2fc6737-3d3f-4da2-afda-f80f25b89af9",
"timestamp": 1500558736123
}
}
},
{
"example": {
"action": {
"text": "a task",
"verb": "assigned"
},
"actor": {
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
},
"changes": {
"fields": [
{
"display": "expanded",
"label": "Project Status",
"name": "projectStatus",
"op": "replace",
"value": "In progress"
}
],
"groups": [
{
"identifier": "c390a4bf-4f54-418a-87ca-5970c332ba17"
}
],
"users": [
{
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
}
]
},
"contents": [
{
"linkedToResource": true,
"mimeType": "application/pdf",
"previewUrl": "https://myapp.com/orders/1234?preview",
"searchText": "string",
"title": "Order request",
"url": "https://myapp.com/orders/1234"
}
],
"eventMetadata": {
"id": "6ed0279c-35ed-4c7e-928e-25e46c080431",
"timestamp": "2020-06-11T15:23:45Z",
"type": "ResourceUpdated"
},
"key": {
"instance": "myclient.myapp.com",
"resourceId": "order-12345",
"source": "b2fc6737-3d3f-4da2-afda-f80f25b89af9",
"timestamp": 1500558736123
}
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appwise/v2/data',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/appwise/v2/data', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/appwise/v2/data',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/appwise/v2/data");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"action": {
"text": "a task",
"verb": "assigned"
},
"actor": {
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
},
"changes": {
"fields": [
{
"display": "expanded",
"label": "Project Status",
"name": "projectStatus",
"op": "replace",
"value": "In progress"
}
],
"groups": [
{
"identifier": "c390a4bf-4f54-418a-87ca-5970c332ba17"
}
],
"users": [
{
"identifier": "bob@a13a9998-e025-4751-8fee-72afdc0fe6d5@2cc88871-e942-4910-96e3-0521d7ae52f4",
"name": "Bob Roberts"
}
]
},
"contents": [
{
"linkedToResource": true,
"mimeType": "application/pdf",
"previewUrl": "https://myapp.com/orders/1234?preview",
"searchText": "string",
"title": "Order request",
"url": "https://myapp.com/orders/1234"
}
],
"eventMetadata": {
"id": "6ed0279c-35ed-4c7e-928e-25e46c080431",
"timestamp": "2020-06-11T15:23:45Z",
"type": "ResourceUpdated"
},
"key": {
"instance": "myclient.myapp.com",
"resourceId": "order-12345",
"source": "b2fc6737-3d3f-4da2-afda-f80f25b89af9",
"timestamp": 1500558736123
}
}
Example response
{}
POST/appwise/v2/data
Publishes content events that contain new or changed data in referenced resources. To access this API, you must configure product-scoped OAuth2 authentication for your application.
Required Scope and Authorization Rules
Scope | Rule |
---|---|
ROLE_APPLICATION | Allows access as the Developer that owns the Product. |
Body Parameters
All information about a change to data in a referenced resource, including the resource key, change description, changes to fields, user access, and content.
ContentEvent object:
Property | Type | Description |
---|---|---|
action | Action | Description of changes in the event |
actor | ContentEventActor | The user (accountName) who made the change. There is no actor for system-generated changes. |
changes | Changes | List of field and user access changes to apply to the resource. This field must not be provided if the resource is being deleted ("action.delete": true). |
contents | array of Content | Content items associated with the resource |
eventMetadata | EventMetadata | Metadata associated with the event |
key | Key | Event key. Required. |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | Success | |
400 | Bad Request | Input is invalid or malformed | ContentEventError |
401 | Unauthorized | Unauthorized to publish this event | ContentEventError |
500 | Internal Server Error | An internal error occurred during event processing | ContentEventError |
Currency Exchange Rate
Deactivate a Currency Exchange Rate
Example request
curl -X PATCH https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
PATCH https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
method: 'patch',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"properties": {
"active": {
"description": "Currency Exchange Rates can be only deactivated. Allowed value: false.",
"type": "boolean"
}
},
"example": {
"active": true
}
},
{
"description": "Currency Exchange Rate active object",
"example": {
"active": false
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.patch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.patch 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"active": false
}
Example response
{
"active": true,
"authenticationType": "USER_LOGIN",
"baseCurrency": "GTQ",
"counterCurrency": "INR",
"currencyExchangeRateUuid": "76b11329-e3a5-4944-93b0-0411c9f63369",
"oauthKey": "",
"rate": 0.3,
"userId": 3434556,
"validFrom": 1507077229000
}
PATCH/channel/v1/exchangeRates/{currencyExchangeRateUuid}
Deactivate a Currency Exchange Rate. To stop supporting currency exchange on your marketplace, deactivate a rate. This will prevent the exchange rate from being used to convert usage.
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*currencyExchangeRateUuid | path | string | The unique identifier of the currency exchange rate. |
Body Parameters
Currency Exchange Rate active
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | OK | CurrencyExchangeRate |
404 | Not Found | Not Found |
Read all Currency Exchange Rates
Example request
curl -X GET https://{marketplaceURL}/api/channel/v1/exchangeRates \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/channel/v1/exchangeRates HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/channel/v1/exchangeRates', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"content": [
{
"active": true,
"authenticationType": "CHANNEL_CONSUMER_LOGIN",
"baseCurrency": "USD",
"counterCurrency": "CAD",
"currencyExchangeRateUuid": "9ec1a010-2814-42c9-a9e0-44ed1f5895f0",
"oauthKey": "dNcCBthw82",
"rate": 1.25,
"userId": 1111,
"validFrom": 1507077229000
}
],
"links": [
{
"href": "http://appdirect/api/channel/v1/exchangeRates?page=1",
"rel": "next"
}
],
"page": {
"number": 0,
"size": 20,
"totalElements": 50,
"totalPages": 3
}
}
GET/channel/v1/exchangeRates
Retrieve all of the current and historical exchange rates set on the marketplace.
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
baseCurrency | query | string of enum: USD CAD EUR JPY GBP KRW CHF SEK SGD MYR AUD MXN INR BRL DKK NZD NOK ZAR PHP CNY SAR GTQ |
Supported currencies for the system | |
counterCurrency | query | string of enum: USD CAD EUR JPY GBP KRW CHF SEK SGD MYR AUD MXN INR BRL DKK NZD NOK ZAR PHP CNY SAR GTQ |
Supported currencies for the system | |
page | query | integer | 0 | The page number. Optional. |
size | query | integer | 20 | The number of application returned by page. Optional. |
sortField | query | string of enum: BASE_CURRENCY COUNTER_CURRENCY VALID_FROM |
VALID_FROM | The order field. Optional. |
sortOrder | query | string of enum: ASC DESC |
DESC | The sort direction. Optional. |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | OK | CurrencyExchangeRateList |
404 | Not Found | Not Found |
Create new Currency Exchange Rate
Example request
curl -X POST https://{marketplaceURL}/api/channel/v1/exchangeRates \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/channel/v1/exchangeRates HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"type": "object",
"title": "CurrencyExchangeRateRequest",
"required": [
"baseCurrency",
"counterCurrency",
"rate"
],
"properties": {
"baseCurrency": {
"allOf": [
{
"description": "Supported currencies for the system",
"type": "string",
"title": "Currency",
"enum": [
"USD",
"CAD",
"EUR",
"JPY",
"GBP",
"KRW",
"CHF",
"SEK",
"SGD",
"MYR",
"AUD",
"MXN",
"INR",
"BRL",
"DKK",
"NZD",
"NOK",
"ZAR",
"PHP",
"CNY",
"SAR",
"GTQ"
]
},
{
"description": "A supported External Currency"
}
]
},
"counterCurrency": {
"allOf": [
{
"description": "Supported currencies for the system",
"type": "string",
"title": "Currency",
"enum": [
"USD",
"CAD",
"EUR",
"JPY",
"GBP",
"KRW",
"CHF",
"SEK",
"SGD",
"MYR",
"AUD",
"MXN",
"INR",
"BRL",
"DKK",
"NZD",
"NOK",
"ZAR",
"PHP",
"CNY",
"SAR",
"GTQ"
]
},
{
"description": "A supported Marketplace Currency"
}
]
},
"rate": {
"description": "A currency pair is the quotation and pricing structure of the currencies traded in a forex market. A Currency Pair is represented as XXX/YYY where XXX is the Base currency and YYY is the Counter currency.\n\nIn AppDirect the Base currency is an external currency and the Counter currency is a supported currency in your marketplace.\n\nWhen an exchange rate is provided with a Currency Pair, it represents how much of the Counter currency is required to purchase 1 unit of the Base currency.\nEUR/USD=1.18; EUR is the Base currency and USD is the counter currency.\n1 EUR is equal to 1.18 USD.\nIn order to buy 1 EUR, the buyer must pay 1.18 USD.",
"type": "number"
}
},
"example": {
"baseCurrency": "USD",
"counterCurrency": "CAD",
"rate": 0.5
}
},
{
"description": "Currency Exchange Rate object",
"example": {
"baseCurrency": "USD",
"counterCurrency": "CAD",
"rate": 0.2
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/channel/v1/exchangeRates', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Request body
{
"baseCurrency": "USD",
"counterCurrency": "CAD",
"rate": 0.2
}
Example response
{
"active": true,
"authenticationType": "USER_LOGIN",
"baseCurrency": "GTQ",
"counterCurrency": "INR",
"currencyExchangeRateUuid": "76b11329-e3a5-4944-93b0-0411c9f63369",
"oauthKey": "",
"rate": 0.3,
"userId": 3434556,
"validFrom": 1507077229000
}
POST/channel/v1/exchangeRates
Define a new exchange rate to be used when custom metered usage is reported to your marketplace by a Developer in a currency that isn't supported by your marketplace. This enables you to invoice your customers in your marketplace currency, even though a Developer's external price list for metered usage charges (like Amazon Web Services) might be in a different currency.
Body Parameters
The new Currency Exchange Rate
CurrencyExchangeRateRequest object:
Property | Type | Description |
---|---|---|
baseCurrency | Currency | A supported External Currency |
counterCurrency | Currency | A supported Marketplace Currency |
rate | number | A currency pair is the quotation and pricing structure of the currencies traded in a forex market. A Currency Pair is represented as XXX/YYY where XXX is the Base currency and YYY is the Counter currency. In AppDirect the Base currency is an external currency and the Counter currency is a supported currency in your marketplace. When an exchange rate is provided with a Currency Pair, it represents how much of the Counter currency is required to purchase 1 unit of the Base currency. EUR/USD=1.18; EUR is the Base currency and USD is the counter currency. 1 EUR is equal to 1.18 USD. In order to buy 1 EUR, the buyer must pay 1.18 USD. |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | OK | CurrencyExchangeRate |
404 | Not Found | Not Found |
Read a Currency Exchange Rate
Example request
curl -X GET https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
GET https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.get('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.get 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
Example response
{
"active": true,
"authenticationType": "USER_LOGIN",
"baseCurrency": "GTQ",
"counterCurrency": "INR",
"currencyExchangeRateUuid": "76b11329-e3a5-4944-93b0-0411c9f63369",
"oauthKey": "",
"rate": 0.3,
"userId": 3434556,
"validFrom": 1507077229000
}
GET/channel/v1/exchangeRates/{currencyExchangeRateUuid}
Retrieve the details of a specific Currency Exchange Rate.
Parameters
Parameter | Type | Data Type | Default | Description |
---|---|---|---|---|
*currencyExchangeRateUuid | path | string | The unique identifier of the currency exchange rate. |
Responses
Status | Meaning | Description | Definition |
---|---|---|---|
200 | OK | OK | CurrencyExchangeRate |
404 | Not Found | Not Found |
Customer Notifications
Create or update a common email template element
This call allows you to create a new template element (for example, a variable) or update an existing one.
Example request
curl -X POST https://{marketplaceURL}/api/notification/v1/templates/common/email \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
POST https://{marketplaceURL}/api/notification/v1/templates/common/email HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'https://{marketplaceURL}/api/notification/v1/templates/common/email',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"allOf": [
{
"type": "object",
"title": "NotificationCommonEmailElementWS",
"required": [
"type",
"content",
"locale"
],
"properties": {
"content": {
"description": "Email notification content",
"type": "string"
},
"defaultCommonElement": {
"description": "If the elements are default common elements",
"type": "boolean"
},
"enabled": {
"description": "If the email template is enabled",
"type": "boolean"
},
"id": {
"description": "Email notification template ID",
"type": "number"
},
"locale": {
"description": "Email notification locale to determine the language",
"type": "string"
},
"partner": {
"description": "Partner being used to render the email",
"type": "string"
},
"type": {
"allOf": [
{
"type": "string",
"title": "NotificationCommonElementType",
"enum": [
"UNSUBSCRIBE"
]
},
{
"description": "Email notification common element type"
}
]
}
}
},
{
"example": {
"content": "This is a test.",
"enabled": true,
"locale": "en_US",
"partner": "APPDIRECT",
"type": "UNSUBSCRIBE"
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/notification/v1/templates/common/email',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://{marketplaceURL}/api/notification/v1/templates/common/email', params={
}, headers = headers)
print r.json()
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://{marketplaceURL}/api/notification/v1/templates/common/email',
params: {
}, headers: headers
p JSON.parse(result)
URL obj = new URL("https://{marketplaceURL}/a