RMAPortal API
API change historyInitial Release
Create RMAToken
Initiate a return in the ModusLink Return portal by providing the original order information.
Try itRequest
Request URL
Request headers
-
string
Client specific ID, provided by ModusLink during the onboarding process.
-
string
Client specific ID, provided by ModusLink during the onboarding process.
-
(optional)stringMedia type of the body sent to the API.
Request body
{
"requestHeader": {
"externalMessageReference": "MODUSDEMOUS_2_R",
"client":"MODUSDEMOUS",
"requestReference": "MODUSDEMOUS_2_R"
},
"rma": {
"returnReason": null,
"userReference": "Willem de Boer",
"transactionId": null,
"language": "en",
"clientReturnURL": "https://google.com",
"dateTimeOrder": "2018-02-08T15:45:58 +00.00",
"amount": {
"amountType": "totalGross",
"currencyISO3": "GBP",
"value": "242.00"
},
"dynamicField": [
{
"name": "RMAOrderRef",
"value": "MODUSDEMOUS_2_R"
},
{
"name": "name",
"value": "Value"
}
]
},
"partner": [
{
"partnerType": "BillTo",
"companyData": {
"name": "Company name",
"phone": [{
"phoneType": "office",
"value": "121212211"
}]
},
"personData": {
"firstName": "John_GB",
"lastName": "Doe_GB",
"fiscalid": "VAT_number",
"phone": [{
"phoneType": "home",
"value": "121212211"
}],
"email": [{
"emailType": "email",
"value": "wim_deboer@moduslink.com"
}],
"locale": "en-GB"
},
"addressData": {
"address": [
{
"line": "1",
"value": "Lakeside Rd"
},
{
"line": "2",
"value": "27"
}
],
"postalCode": "N13 4PS",
"city": "London",
"countryName": "United Kingdom",
"countryISO3": "GBR"
}
},
{
"partnerType": "ShipTo",
"companyData": {
"name": "Company name",
"phone": [{
"phoneType": "office",
"value": "121212211"
}]
},
"personData": {
"firstName": "John_GB",
"lastName": "Doe_GB",
"fiscalid": "VAT_number",
"phone": [{
"phoneType": "home",
"value": "121212211"
}],
"email": [{
"emailType": "email",
"value": "wim_deboer@moduslink.com"
}],
"locale": "en-GB"
},
"addressData": {
"address": [
{
"line": "1",
"value": "Lakeside Rd"
},
{
"line": "2",
"value": "27"
}
],
"postalCode": "N13 4PS",
"city": "London",
"countryName": "United Kingdom",
"countryISO3": "GBR"
}
}
],
"item": [
{
"sku": "131270",
"itemDescription": "Description",
"quantity": {
"uom": "EA",
"value": "15"
},
"amount": [
{
"amountType": "netprice",
"currencyISO3": "GBP",
"value": "7.49"
},
{
"amountType": "totaltax",
"currencyISO3": "GBP",
"value": "0.00"
}
],
"dynamicField": [
{
"name": "RMALineRef",
"value": "1"
},
{
"name": "RMAOrderLineRef",
"value": "1"
},
{
"name": "RMALinePrice",
"value": "7.49"
}
]
},
{
"sku": "131271",
"itemDescription": "Description",
"quantity": {
"uom": "EA",
"value": "15"
},
"amount": [
{
"amountType": "netprice",
"currencyISO3": "GBP",
"value": "7.49"
},
{
"amountType": "totaltax",
"currencyISO3": "GBP",
"value": "0.00"
}
],
"dynamicField": [
{
"name": "RMALineRef",
"value": "1"
},
{
"name": "RMAOrderLineRef",
"value": "1"
},
{
"name": "RMALinePrice",
"value": "7.49"
}
]
}
]
}
{
"type": "object",
"description": "Provides information to create a new order",
"properties": {
"requestHeader": {
"type": "object",
"description": "Provides information to create/about a new order",
"properties": {
"externalMessageReference": {
"type": "string",
"maxLength": 50,
"description": "REQUIRED. Unique client order reference. Duplicates will NOT be rejected at ML order system"
},
"client": {
"type": "string",
"maxLength": 40,
"description": "REQUIRED. Client Name, to be provided by Moduslink as part of onboarding "
},
"requestReference": {
"type": "string",
"maxLength": 50,
"description": "REQUIRED. Unique client order reference. Usually same as externalMessageReference, can be different. Duplicates will be rejected in ML order system."
}
},
"required": [
"externalMessageReference",
"client",
"requestReference"
]
},
"rma": {
"type": "object",
"description": "Provides return information.",
"properties": {
"returnReason": {
"type": "string",
"maxLength": 50,
"description": "Predefined return reason value, selected by a user. Valid reasons will be defined between Client and Moduslink"
},
"userReference": {
"type": "string",
"maxLength": 50,
"description": "User first and last name."
},
"transactionId": {
"type": "string",
"maxLength": 50,
"description": "Unique RMA Transaction ID. This is only provided to update an RMA after it has been created in the return portal and prior to the return being created by the consumer. When creating an rma this remains null."
},
"language": {
"type": "string",
"maxLength": 10,
"description": "Return language code (en, nl, fr, etc). The language is used to determine the language displayed to the consumer when re-directed to the portal"
},
"clientReturnURL": {
"type": "string",
"description": "URL of the site used to originate the return. After creation the user is re-directed to this url"
},
"amount": {
"type": "object",
"description": "Amount Info",
"properties": {
"currencyISO3": {
"type": "string",
"description": "ISO_3 currency code (EUR, USD, GBP, etc)."
},
"amountType": {
"type": "string",
"description": "Amount type: \n\n +netprice must contain the NETPRICE and goes into price (Excl. VAT) on the UI. \n\n+totaltax must contain the VAT_AMOUNT and goes into VAT on the UI. \n\n item/dynamicField(=RMALinePrice)/value must contain the GROSSPRICE and goes into Price (Incl. VAT) on the UI",
"enum": [
"totalnet",
"totaltax",
"totalgross",
"authorized",
"netprice",
"grossprice",
"discount"
]
},
"value": {
"type": "string",
"description": "Amount Value"
}
}
},
"dateTimeOrder": {
"type": "string",
"description": "Date original order was created. format yyyy-mm-ddT00:00:00 +00.00"
},
"dynamicField": {
"type": "array",
"items": {
"type": "object",
"description": "Dynamic fields \n\nEach item needs to have a dynamic field RMALinePrice which will hold the gross price of the product.",
"properties": {
"name": {
"type": "string",
"maxLength": 60,
"description": "Name of the dynamic field"
},
"value": {
"type": "string",
"maxLength": 2000,
"description": "Value of the dynamic field"
}
}
}
}
},
"required": [
"returnReason",
"userReference",
"clientReturnURL",
"dateTimeOrder"
]
},
"partner": {
"type": "array",
"items": {
"type": "object",
"description": "Used to provide Order BillTo and ShipTo info.",
"properties": {
"partnerType": {
"type": "string",
"description": "Partner type.",
"enum": [
"BillTo",
"ShipTo"
]
},
"companyData": {
"type": "object",
"description": "Provides Company data. REQUIRED if Company return.",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 70,
"description": "BillTo Company name."
},
"phone": {
"type": "array",
"description": "BillTo Company phone info. Only one phone number will be mapped.",
"items": {
"type": "object",
"description": "BillTo phone info.",
"properties": {
"phoneType": {
"type": "string",
"description": "BillTo Person phone type (office, home, mobile).",
"enum": [
"office",
"home",
"mobile"
]
},
"value": {
"type": "string",
"description": "BillTo Person phone number."
}
}
}
}
}
},
"personData": {
"type": "object",
"description": "Provides Person Data.",
"required": [
"firstName",
"lastName",
"email",
"phone"
],
"properties": {
"firstName": {
"type": "string",
"maxLength": 20,
"description": "Person First Name."
},
"lastName": {
"type": "string",
"maxLength": 20,
"description": "Person Last Name."
},
"fiscalid": {
"type": "object",
"maxLength": 30,
"description": "Company VAT number."
},
"phone": {
"type": "array",
"description": "Person phone number. Only one phone number will be mapped.",
"items": {
"type": "object",
"description": "BillTo phone info.",
"properties": {
"phoneType": {
"type": "string",
"description": "BillTo Person phone type (office, home, mobile).",
"enum": [
"office",
"home",
"mobile"
]
},
"value": {
"type": "string",
"description": "BillTo Person phone number."
}
}
}
},
"email": {
"type": "array",
"description": "Person email.",
"items": {
"type": "object",
"description": "the email address",
"properties": {
"emailType": {
"type": "string",
"description": "Email."
},
"value": {
"type": "string",
"maxLength": 200,
"description": "Person email address."
}
}
}
},
"locale": {
"type": "string",
"maxLength": 6,
"description": "Person language code (nl, en, fr, etc) and ISO 2 Country Code (US, NL, FR, etc)."
}
}
},
"addressData": {
"type": "object",
"required": [
"city",
"countryISO3",
"countryName"
],
"properties": {
"address": {
"type": "array",
"items": {
"type": "object",
"description": "Address",
"properties": {
"line": {
"type": "string",
"description": "REQUIRED. Address - sequemtial Line number e.g. 1,2,3"
},
"value": {
"type": "string",
"maxLength": 40,
"description": "REQUIRED for line 1, Address Value, at least one address line is required"
}
}
}
},
"postalCode": {
"type": "string",
"maxLength": 10,
"description": "Postal code."
},
"city": {
"type": "string",
"maxLength": 40,
"description": "City name."
},
"state": {
"type": "string",
"maxLength": 3,
"description": "REQUIRED for US and CA."
},
"countryName": {
"type": "string",
"description": "Full country name e.g. \"United States\" "
},
"countryISO3": {
"type": "string",
"description": "ISO_3 Country Code (USA, NLD, FRA, etc)."
}
}
}
},
"required": [
"partnerType"
]
}
},
"item": {
"type": "array",
"items": {
"type": "object",
"description": "Order line/item info, replicate for each item. For each item there needs to be a required dynamicField named: \"RMALinePrice\". This should have the item price as the value ",
"properties": {
"sku": {
"type": "string",
"maxLength": 25,
"description": "Item sales product number/SKU."
},
"itemDescription": {
"type": "string",
"maxLength": 200,
"description": "Part description"
},
"quantity": {
"type": "object",
"description": "Item Quantity info.",
"properties": {
"uom": {
"type": "string",
"description": "Item unit of measure (EA, BX, CS)."
},
"value": {
"type": "string",
"description": "Numeric value."
}
},
"required": [
"uom",
"value"
]
},
"amount": {
"type": "array",
"items": {
"type": "object",
"description": "Amount Info",
"properties": {
"currencyISO3": {
"type": "string",
"description": "ISO_3 currency code (EUR, USD, GBP, etc)."
},
"amountType": {
"type": "string",
"description": "Amount type: \n\n +netprice must contain the NETPRICE and goes into price (Excl. VAT) on the UI. \n\n+totaltax must contain the VAT_AMOUNT and goes into VAT on the UI. \n\n item/dynamicField(=RMALinePrice)/value must contain the GROSSPRICE and goes into Price (Incl. VAT) on the UI",
"enum": [
"totalnet",
"totaltax",
"totalgross",
"authorized",
"netprice",
"grossprice",
"discount"
]
},
"value": {
"type": "string",
"description": "Amount Value"
}
}
}
},
"dynamicField": {
"type": "array",
"items": {
"type": "object",
"description": "Dynamic fields \n\nEach item needs to have a dynamic field RMALinePrice which will hold the gross price of the product.",
"properties": {
"name": {
"type": "string",
"maxLength": 60,
"description": "Name of the dynamic field"
},
"value": {
"type": "string",
"maxLength": 2000,
"description": "Value of the dynamic field"
}
}
}
}
},
"required": [
"sku",
"quantity",
"amount"
]
}
}
},
"example": "{\n \"requestHeader\": {\n \"externalMessageReference\": \"MODUSDEMOUS_2_R\",\n \"client\":\"MODUSDEMOUS\",\n \"requestReference\": \"MODUSDEMOUS_2_R\"\n },\n \"rma\": {\n \"returnReason\": null,\n \"userReference\": \"Willem de Boer\",\n \"transactionId\": null,\n \"language\": \"en\",\n \"clientReturnURL\": \"https://google.com\",\n \"dateTimeOrder\": \"2018-02-08T15:45:58 +00.00\",\n \"amount\": {\n \"amountType\": \"totalGross\",\n \"currencyISO3\": \"GBP\",\n \"value\": \"242.00\"\n },\n \"dynamicField\": [\n {\n \"name\": \"RMAOrderRef\",\n \"value\": \"MODUSDEMOUS_2_R\"\n },\n {\n \"name\": \"name\",\n \"value\": \"Value\"\n }\n ]\n },\n \"partner\": [\n {\n \"partnerType\": \"BillTo\",\n \"companyData\": {\n \"name\": \"Company name\",\n \"phone\": [{\n \"phoneType\": \"office\",\n \"value\": \"121212211\"\n }]\n },\n \"personData\": {\n \"firstName\": \"John_GB\",\n \"lastName\": \"Doe_GB\",\n \"fiscalid\": \"VAT_number\",\n \"phone\": [{\n \"phoneType\": \"home\",\n \"value\": \"121212211\"\n }],\n \"email\": [{\n \"emailType\": \"email\",\n \"value\": \"wim_deboer@moduslink.com\"\n }],\n \"locale\": \"en-GB\"\n },\n \"addressData\": {\n \"address\": [\n {\n \"line\": \"1\",\n \"value\": \"Lakeside Rd\"\n },\n {\n \"line\": \"2\",\n \"value\": \"27\"\n }\n ],\n \"postalCode\": \"N13 4PS\",\n \"city\": \"London\",\n \"countryName\": \"United Kingdom\",\n \"countryISO3\": \"GBR\"\n }\n },\n {\n \"partnerType\": \"ShipTo\",\n \"companyData\": {\n \"name\": \"Company name\",\n \"phone\": [{\n \"phoneType\": \"office\",\n \"value\": \"121212211\"\n }]\n },\n \"personData\": {\n \"firstName\": \"John_GB\",\n \"lastName\": \"Doe_GB\",\n \"fiscalid\": \"VAT_number\",\n \"phone\": [{\n \"phoneType\": \"home\",\n \"value\": \"121212211\"\n }],\n \"email\": [{\n \"emailType\": \"email\",\n \"value\": \"wim_deboer@moduslink.com\"\n }],\n \"locale\": \"en-GB\"\n },\n \"addressData\": {\n \"address\": [\n {\n \"line\": \"1\",\n \"value\": \"Lakeside Rd\"\n },\n {\n \"line\": \"2\",\n \"value\": \"27\"\n }\n ],\n \"postalCode\": \"N13 4PS\",\n \"city\": \"London\",\n \"countryName\": \"United Kingdom\",\n \"countryISO3\": \"GBR\"\n }\n }\n ],\n \"item\": [\n {\n \"sku\": \"131270\",\n \"itemDescription\": \"Description\",\n \"quantity\": {\n \"uom\": \"EA\",\n \"value\": \"15\"\n },\n \"amount\": [\n {\n \"amountType\": \"netprice\",\n \"currencyISO3\": \"GBP\",\n \"value\": \"7.49\"\n },\n {\n \"amountType\": \"totaltax\",\n \"currencyISO3\": \"GBP\",\n \"value\": \"0.00\"\n }\n ],\n \"dynamicField\": [\n {\n \"name\": \"RMALineRef\",\n \"value\": \"1\"\n },\n {\n \"name\": \"RMAOrderLineRef\",\n \"value\": \"1\"\n },\n {\n \"name\": \"RMALinePrice\",\n \"value\": \"7.49\"\n }\n ]\n },\n {\n \"sku\": \"131271\",\n \"itemDescription\": \"Description\",\n \"quantity\": {\n \"uom\": \"EA\",\n \"value\": \"15\"\n },\n \"amount\": [\n {\n \"amountType\": \"netprice\",\n \"currencyISO3\": \"GBP\",\n \"value\": \"7.49\"\n },\n {\n \"amountType\": \"totaltax\",\n \"currencyISO3\": \"GBP\",\n \"value\": \"0.00\"\n }\n ],\n \"dynamicField\": [\n {\n \"name\": \"RMALineRef\",\n \"value\": \"1\"\n },\n {\n \"name\": \"RMAOrderLineRef\",\n \"value\": \"1\"\n },\n {\n \"name\": \"RMALinePrice\",\n \"value\": \"7.49\"\n }\n ]\n }\n ]\n}"
}
Responses
200 OK
OK
Representations
{
"transactionID": "string",
"resultCode": "0",
"resultMessage": "Data successfully inserted."
}
{
"type": "object",
"properties": {
"transactionID": {
"type": "string",
"description": "The transaction token"
},
"resultCode": {
"type": "string",
"description": "The result code \"0\" when successfull",
"example": "0"
},
"resultMessage": {
"type": "string",
"description": "The result message",
"example": "Data successfully inserted."
}
}
}
401 Unauthorized
invalid authentication
Representations
{
"statusCode": "401",
"message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
{
"type": "object",
"properties": {
"statusCode": {
"type": "string",
"description": "the error code",
"example": "401"
},
"message": {
"type": "string",
"description": "the error message",
"example": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
}
}
500 Internal Server Error
Server Error
Representations
{
"statusCode": "500",
"activityId": "d25eb365-3da2-48ff-b907-1754166f5947",
"message": "Internal server error"
}
{
"type": "object",
"properties": {
"statusCode": {
"type": "string",
"description": "result of order create",
"example": "500"
},
"activityId": {
"type": "string",
"description": "If not successful the internal activity ID",
"example": "d25eb365-3da2-48ff-b907-1754166f5947"
},
"message": {
"type": "string",
"description": "If not successful the error message. null if successfull",
"example": "Internal server error"
}
}
}
Code samples
@ECHO OFF
curl -v -X POST "https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens"
-H "ClientConfigId: 112"
-H "ClientAuthKey: 61B66057-D636-4BB5-810A-2FDA54FAB67E"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
--data-ascii "{body}"
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("ClientConfigId", "112");
client.DefaultRequestHeaders.Add("ClientAuthKey", "61B66057-D636-4BB5-810A-2FDA54FAB67E");
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
var uri = "https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens?" + queryString;
HttpResponseMessage response;
// Request body
byte[] byteData = Encoding.UTF8.GetBytes("{body}");
using (var content = new ByteArrayContent(byteData))
{
content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
response = await client.PostAsync(uri, content);
}
}
}
}
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class JavaSample
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URIBuilder builder = new URIBuilder("https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens");
URI uri = builder.build();
HttpPost request = new HttpPost(uri);
request.setHeader("ClientConfigId", "112");
request.setHeader("ClientAuthKey", "61B66057-D636-4BB5-810A-2FDA54FAB67E");
request.setHeader("Content-Type", "application/json");
request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request body
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var params = {
// Request parameters
};
$.ajax({
url: "https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("ClientConfigId","112");
xhrObj.setRequestHeader("ClientAuthKey","61B66057-D636-4BB5-810A-2FDA54FAB67E");
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
},
type: "POST",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* path = @"https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens";
NSArray* array = @[
// Request parameters
@"entities=true",
];
NSString* string = [array componentsJoinedByString:@"&"];
path = [path stringByAppendingFormat:@"?%@", string];
NSLog(@"%@", path);
NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
[_request setHTTPMethod:@"POST"];
// Request headers
[_request setValue:@"112" forHTTPHeaderField:@"ClientConfigId"];
[_request setValue:@"61B66057-D636-4BB5-810A-2FDA54FAB67E" forHTTPHeaderField:@"ClientAuthKey"];
[_request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
// Request body
[_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response = nil;
NSError *error = nil;
NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];
if (nil != error)
{
NSLog(@"Error: %@", error);
}
else
{
NSError* error = nil;
NSMutableDictionary* json = nil;
NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
NSLog(@"%@", dataString);
if (nil != _connectionData)
{
json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
}
if (error || !json)
{
NSLog(@"Could not parse loaded json with error:%@", error);
}
NSLog(@"%@", json);
_connectionData = nil;
}
[pool drain];
return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens');
$url = $request->getUrl();
$headers = array(
// Request headers
'ClientConfigId' => '112',
'ClientAuthKey' => '61B66057-D636-4BB5-810A-2FDA54FAB67E',
'Content-Type' => 'application/json',
'Ocp-Apim-Subscription-Key' => '{subscription key}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_POST);
// Request body
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>
########### Python 2.7 #############
import httplib, urllib, base64
headers = {
# Request headers
'ClientConfigId': '112',
'ClientAuthKey': '61B66057-D636-4BB5-810A-2FDA54FAB67E',
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
})
try:
conn = httplib.HTTPSConnection('api-uat.moduslink.com')
conn.request("POST", "/rmaportalapi/v1/rmaTokens?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = {
# Request headers
'ClientConfigId': '112',
'ClientAuthKey': '61B66057-D636-4BB5-810A-2FDA54FAB67E',
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.parse.urlencode({
})
try:
conn = http.client.HTTPSConnection('api-uat.moduslink.com')
conn.request("POST", "/rmaportalapi/v1/rmaTokens?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
require 'net/http'
uri = URI('https://api-uat.moduslink.com/rmaportalapi/v1/rmaTokens')
request = Net::HTTP::Post.new(uri.request_uri)
# Request headers
request['ClientConfigId'] = '112'
# Request headers
request['ClientAuthKey'] = '61B66057-D636-4BB5-810A-2FDA54FAB67E'
# Request headers
request['Content-Type'] = 'application/json'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body