Order Service
API change historyRequest
Request URL
Request headers
-
(optional)stringMedia type of the body sent to the API.
Request body
Order request
{
"LineItems": [
{
"Name": "Test",
"StoreItemReference": {
"Id": "e619e39a-bf2c-43f1-a45e-f6aed8d6651a",
"ReferenceData": null,
"Version": null
},
"Description": null,
"ReferenceData": null,
"Quantity": 1,
"ItemCustomFieldValues": null
}
],
"ReferenceNumber": "Reference",
"Recipients": [
{
"Address": {
"FirstName": "Will",
"LastName": "Smith",
"Street": "460 Park Ave S.",
"ApartmentOrSuite": "FL 8",
"CareOf": null,
"City": "New York",
"StateOrProvince": "NY",
"Country": "US",
"PostalCode": "10016",
"TelephoneNumber": "212-333-4444",
"Email": null,
"CompanyName": null,
"IsResidential": true,
"Name": null
},
"ReferenceData": null,
"ShipmentNumber": 0,
"SignatureReleaseType": 0,
"ShippingMethodId": "cf623074-8521-4d12-a3fa-f29f77f61269"
}
],
"SpecialInstructionCodes": [
""
],
"DiscountCodes": [],
"PaymentMethod": {
"PaymentMethodType": 1,
"CreditLimit": {},
"CorporateAccount": {
"Id": "00000000-0000-0000-0000-000000000000"
},
"UserPCardPaymentMethod": {
"UserPCardId": "00000000-0000-0000-0000-000000000000",
"Name": "string",
"ExpirationDate": "2019-10-01T13:07:08.875Z",
"Number": "string",
"BillingPostalCode": "string"
},
"UserCreditCardReferencePaymentMethod": {
"Id": "00000000-0000-0000-0000-000000000000"
}
},
"ShipFromInfo": {
"FirstName": "Jesus Raul",
"LastName": "Moncada",
"Email": "raulworking@gmail.com",
"CompanyName": "Client Connect Test",
"TelephoneNumber": "555-555-1111"
},
"Options": {
"AdditionalProcessingHours": 120,
"TaxExemptStatusEnabled": false,
"RecipientNotificationOptions": null
}
}
<OrderRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<LineItems>
<AddLineItemRequest>
<Name />
<StoreItemReference>
<Id>c51ddfea-dd94-459f-8935-90c881461dbd</Id>
</StoreItemReference>
<Quantity>1</Quantity>
</AddLineItemRequest>
</LineItems>
<ReferenceNumber>Reference</ReferenceNumber>
<Recipients>
<AddRecipientRequest>
<Address>
<FirstName>Will</FirstName>
<LastName>Smith</LastName>
<Street>460 Park Ave S.</Street>
<ApartmentOrSuite>FL 8</ApartmentOrSuite>
<City>New York</City>
<StateOrProvince>NY</StateOrProvince>
<Country>US</Country>
<PostalCode>10016</PostalCode>
<TelephoneNumber>212-333-4444</TelephoneNumber>
<IsResidential>true</IsResidential>
</Address>
<ShipmentNumber>0</ShipmentNumber>
<SignatureReleaseType xsi:nil="true" />
<ShippingMethodId>cf623074-8521-4d12-a3fa-f29f77f61269</ShippingMethodId>
<DistributionListId>00000000-0000-0000-0000-000000000000</DistributionListId>
<AddressId>00000000-0000-0000-0000-000000000000</AddressId>
</AddRecipientRequest>
</Recipients>
<SpecialInstructionCodes>
<string />
</SpecialInstructionCodes>
<DiscountCodes />
<PaymentMethod>
<PaymentMethodType>CreditLimit</PaymentMethodType>
<CreditLimit />
<CorporateAccount>
<Id>00000000-0000-0000-0000-000000000000</Id>
</CorporateAccount>
<UserPCardPaymentMethod>
<UserPCardId xsi:nil="true" />
<ExpirationDate>0001-01-01T00:00:00</ExpirationDate>
</UserPCardPaymentMethod>
<UserCreditCardReferencePaymentMethod>
<Id>00000000-0000-0000-0000-000000000000</Id>
</UserCreditCardReferencePaymentMethod>
</PaymentMethod>
</OrderRequest>
Responses
200 OK
Representations
{
"OrderFriendlyId": "string",
"Submitted": "string",
"OrderId": "00000000-0000-0000-0000-000000000000",
"FinancialDetail": {
"NonDeliveryAdjustmentSubtotal": 0.0,
"NonDeliveryDiscountAdjustmentSubtotal": 0.0,
"NonDeliveryDiscountSubtotal": 0.0,
"NonDeliverySubtotal": 0.0,
"NonDeliveryOneTimeChargeAdjustmentSubtotal": 0.0,
"NonDeliveryOneTimeChargeDiscountAdjustmentSubtotal": 0.0,
"NonDeliveryOneTimeChargeDiscountSubtotal": 0.0,
"NonDeliveryOneTimeChargeSubtotal": 0.0,
"DeliveryAdjustmentSubtotal": 0.0,
"DeliveryDiscountAdjustmentSubtotal": 0.0,
"DeliveryDiscountSubtotal": 0.0,
"DeliverySubtotal": 0.0,
"TaxAdjustmentSubtotal": 0.0,
"TaxSubtotal": 0.0,
"AdjustmentSubtotal": 0.0,
"DiscountSubtotal": 0.0,
"Subtotal": 0.0,
"Total": 0.0,
"HandlingSubtotal": 0.0,
"HandlingDiscountSubtotal": 0.0,
"HandlingOneTimeChargeSubtotal": 0.0,
"HandlingOneTimeChargeDiscountSubtotal": 0.0,
"HandlingAdjustmentSubtotal": 0.0,
"HandlingDiscountAdjustmentSubtotal": 0.0,
"HandlingOneTimeChargeAdjustmentSubtotal": 0.0,
"HandlingOneTimeChargeDiscountAdjustmentSubtotal": 0.0
},
"Status": 1,
"LineItemDetails": [
{
"LineItemId": "00000000-0000-0000-0000-000000000000",
"LineItemFriendlyId": "string",
"OfferingDetails": {
"Other": [
{
"OfferingId": "00000000-0000-0000-0000-000000000000",
"OfferingName": "string",
"OfferingTypeId": "00000000-0000-0000-0000-000000000000",
"OfferingTypeName": "string",
"Quantity": 0,
"ListPrice": 0.0,
"Price": 0.0,
"ListOneTimeCharge": 0.0,
"OneTimeCharge": 0.0,
"ProductionHoursRequired": 0,
"DiscountedAmount": 0.0,
"DiscountedOneTimeChargeAmount": 0.0,
"OfferingRetirementDate": "string",
"OfferingExpirationDate": "string"
}
],
"PrintOptions": [
{
"OfferingId": "00000000-0000-0000-0000-000000000000",
"OfferingName": "string",
"OfferingTypeId": "00000000-0000-0000-0000-000000000000",
"OfferingTypeName": "string",
"Quantity": 0,
"ListPrice": 0.0,
"Price": 0.0,
"ListOneTimeCharge": 0.0,
"OneTimeCharge": 0.0,
"ProductionHoursRequired": 0,
"DiscountedAmount": 0.0,
"DiscountedOneTimeChargeAmount": 0.0,
"OfferingRetirementDate": "string",
"OfferingExpirationDate": "string"
}
],
"BindingAndCovers": [
{
"OfferingId": "00000000-0000-0000-0000-000000000000",
"OfferingName": "string",
"OfferingTypeId": "00000000-0000-0000-0000-000000000000",
"OfferingTypeName": "string",
"Quantity": 0,
"ListPrice": 0.0,
"Price": 0.0,
"ListOneTimeCharge": 0.0,
"OneTimeCharge": 0.0,
"ProductionHoursRequired": 0,
"DiscountedAmount": 0.0,
"DiscountedOneTimeChargeAmount": 0.0,
"OfferingRetirementDate": "string",
"OfferingExpirationDate": "string"
}
],
"TabsAndInserts": [
{
"OfferingId": "00000000-0000-0000-0000-000000000000",
"OfferingName": "string",
"OfferingTypeId": "00000000-0000-0000-0000-000000000000",
"OfferingTypeName": "string",
"Quantity": 0,
"ListPrice": 0.0,
"Price": 0.0,
"ListOneTimeCharge": 0.0,
"OneTimeCharge": 0.0,
"ProductionHoursRequired": 0,
"DiscountedAmount": 0.0,
"DiscountedOneTimeChargeAmount": 0.0,
"OfferingRetirementDate": "string",
"OfferingExpirationDate": "string"
}
],
"CustomOptions": [
{
"OfferingId": "00000000-0000-0000-0000-000000000000",
"OfferingName": "string",
"OfferingTypeId": "00000000-0000-0000-0000-000000000000",
"OfferingTypeName": "string",
"Quantity": 0,
"ListPrice": 0.0,
"Price": 0.0,
"ListOneTimeCharge": 0.0,
"OneTimeCharge": 0.0,
"ProductionHoursRequired": 0,
"DiscountedAmount": 0.0,
"DiscountedOneTimeChargeAmount": 0.0,
"OfferingRetirementDate": "string",
"OfferingExpirationDate": "string"
}
]
},
"Price": 0.0,
"OneTimeCharge": 0.0,
"Discount": 0.0,
"OneTimeChargeDiscount": 0.0,
"Adjustment": 0.0,
"OneTimeChargeAdjustment": 0.0,
"DiscountAdjustment": 0.0,
"OneTimeChargeDiscountAdjustment": 0.0,
"ReferenceData": "string",
"ProductionHoursRequired": 0,
"Quantity": 0
}
],
"RecipientShippedPackages": {},
"RecipientDetails": [
{
"RecipientId": "00000000-0000-0000-0000-000000000000",
"Tax": 0.0,
"ExpectedShipDate": "string",
"ExpectedDeliveryDate": "string",
"DeliveryCharge": 0.0,
"EstimatedPackageCount": 0,
"ReferenceData": "string",
"DeliveryDiscount": 0.0,
"DeliveryTax": 0.0
}
],
"OfferingDetails": [
{
"OfferingId": "00000000-0000-0000-0000-000000000000",
"Price": 0.0,
"OneTimeCharge": 0.0,
"Discount": 0.0,
"OneTimeChargeDiscount": 0.0,
"ProductionHoursRequired": 0,
"PricingLevel": 1,
"Quantity": 0,
"OfferingTypeId": "00000000-0000-0000-0000-000000000000"
}
],
"TotalProductionHoursRequired": 0,
"DiscountDetails": [
{
"DiscountCode": "string",
"NonDeliveryDiscountSubtotal": 0.0,
"NonDeliveryOneTimeChargeDiscountSubtotal": 0.0,
"DeliveryDiscountSubtotal": 0.0,
"HandlingDiscountSubtotal": 0.0,
"HandlingOneTimeChargeDiscountSubtotal": 0.0
}
],
"CutoffDate": "string",
"EarliestPossibleShipDate": "string",
"EarliestExpectedDeliveryDate": "string",
"TotalEstimatedPackageCount": 0
}
<OrderReceipt xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OrderId>ac676edd-a0b1-451a-bc90-bf1cf3620253</OrderId>
<FinancialDetail>
<NonDeliveryAdjustmentSubtotal>0</NonDeliveryAdjustmentSubtotal>
<NonDeliveryDiscountAdjustmentSubtotal>0</NonDeliveryDiscountAdjustmentSubtotal>
<NonDeliveryDiscountSubtotal>0</NonDeliveryDiscountSubtotal>
<NonDeliverySubtotal>5.05</NonDeliverySubtotal>
<NonDeliveryOneTimeChargeAdjustmentSubtotal>0</NonDeliveryOneTimeChargeAdjustmentSubtotal>
<NonDeliveryOneTimeChargeDiscountAdjustmentSubtotal>0</NonDeliveryOneTimeChargeDiscountAdjustmentSubtotal>
<NonDeliveryOneTimeChargeDiscountSubtotal>0</NonDeliveryOneTimeChargeDiscountSubtotal>
<NonDeliveryOneTimeChargeSubtotal>0.00</NonDeliveryOneTimeChargeSubtotal>
<DeliveryAdjustmentSubtotal>0</DeliveryAdjustmentSubtotal>
<DeliveryDiscountAdjustmentSubtotal>0</DeliveryDiscountAdjustmentSubtotal>
<DeliveryDiscountSubtotal>0</DeliveryDiscountSubtotal>
<DeliverySubtotal>13.27</DeliverySubtotal>
<TaxAdjustmentSubtotal>0</TaxAdjustmentSubtotal>
<TaxSubtotal>1.95</TaxSubtotal>
<AdjustmentSubtotal>0</AdjustmentSubtotal>
<DiscountSubtotal>0</DiscountSubtotal>
<Subtotal>23.32</Subtotal>
<Total>25.27</Total>
<HandlingSubtotal>5</HandlingSubtotal>
<HandlingDiscountSubtotal>0</HandlingDiscountSubtotal>
<HandlingOneTimeChargeSubtotal>0</HandlingOneTimeChargeSubtotal>
<HandlingOneTimeChargeDiscountSubtotal>0</HandlingOneTimeChargeDiscountSubtotal>
<HandlingAdjustmentSubtotal>0</HandlingAdjustmentSubtotal>
<HandlingDiscountAdjustmentSubtotal>0</HandlingDiscountAdjustmentSubtotal>
<HandlingOneTimeChargeAdjustmentSubtotal>0</HandlingOneTimeChargeAdjustmentSubtotal>
<HandlingOneTimeChargeDiscountAdjustmentSubtotal>0</HandlingOneTimeChargeDiscountAdjustmentSubtotal>
</FinancialDetail>
<LineItemDetails>
<LineItemQuoteDetail>
<LineItemId>3bc4165c-6055-4999-a8cf-6b0e5e738c07</LineItemId>
<OfferingDetails>
<ItemOfferingDetailGroup>
<Group>
<ItemOfferingDetailGroup>BindingAndCovers</ItemOfferingDetailGroup>
</Group>
<Details>
<ArrayOfRESTItemOfferingDetail>
<RESTItemOfferingDetail>
<OfferingId>dc9d8d74-6d0c-4a39-be6f-b43dde4e248e</OfferingId>
<OfferingName>Matte</OfferingName>
<OfferingTypeId>318d01f7-9d0f-44c9-a7a3-dcdc0935dd7d</OfferingTypeId>
<OfferingTypeName>PaperStock</OfferingTypeName>
<Quantity>1</Quantity>
<ListPrice>0</ListPrice>
<Price>0.6500</Price>
<ListOneTimeCharge>0</ListOneTimeCharge>
<OneTimeCharge>0.0000</OneTimeCharge>
<ProductionHoursRequired>0</ProductionHoursRequired>
<DiscountedAmount>0</DiscountedAmount>
<DiscountedOneTimeChargeAmount>0</DiscountedOneTimeChargeAmount>
<OfferingRetirementDate xsi:nil="true" />
<OfferingExpirationDate xsi:nil="true" />
</RESTItemOfferingDetail>
<RESTItemOfferingDetail>
<OfferingId>2303752c-b973-11d3-be26-0050da12a5a6</OfferingId>
<OfferingName>Black Vinyl</OfferingName>
<OfferingTypeId>318d01f7-9d0f-44c9-a7a3-dcdc0935dd7d</OfferingTypeId>
<OfferingTypeName>PaperStock</OfferingTypeName>
<Quantity>1</Quantity>
<ListPrice>0</ListPrice>
<Price>0.5000</Price>
<ListOneTimeCharge>0</ListOneTimeCharge>
<OneTimeCharge>0.0000</OneTimeCharge>
<ProductionHoursRequired>0</ProductionHoursRequired>
<DiscountedAmount>0</DiscountedAmount>
<DiscountedOneTimeChargeAmount>0</DiscountedOneTimeChargeAmount>
<OfferingRetirementDate xsi:nil="true" />
<OfferingExpirationDate xsi:nil="true" />
</RESTItemOfferingDetail>
<RESTItemOfferingDetail>
<OfferingId>2303753d-b973-11d3-be26-0050da12a5a6</OfferingId>
<OfferingName>Spiral (Small Black)</OfferingName>
<OfferingTypeId>bd5d7c94-7263-4d54-b02f-236bb28fe736</OfferingTypeId>
<OfferingTypeName>Binding</OfferingTypeName>
<Quantity>1</Quantity>
<ListPrice>0</ListPrice>
<Price>3.5000</Price>
<ListOneTimeCharge>0</ListOneTimeCharge>
<OneTimeCharge>0.0000</OneTimeCharge>
<ProductionHoursRequired>0</ProductionHoursRequired>
<DiscountedAmount>0</DiscountedAmount>
<DiscountedOneTimeChargeAmount>0</DiscountedOneTimeChargeAmount>
<OfferingRetirementDate xsi:nil="true" />
<OfferingExpirationDate xsi:nil="true" />
</RESTItemOfferingDetail>
</ArrayOfRESTItemOfferingDetail>
</Details>
</ItemOfferingDetailGroup>
<ItemOfferingDetailGroup>
<Group>
<ItemOfferingDetailGroup>PrintOptions</ItemOfferingDetailGroup>
</Group>
<Details>
<ArrayOfRESTItemOfferingDetail>
<RESTItemOfferingDetail>
<OfferingId>23037521-b973-11d3-be26-0050da12a5a6</OfferingId>
<OfferingName>White Paper (24 lb Bright)</OfferingName>
<OfferingTypeId>318d01f7-9d0f-44c9-a7a3-dcdc0935dd7d</OfferingTypeId>
<OfferingTypeName>PaperStock</OfferingTypeName>
<Quantity>5</Quantity>
<ListPrice>0</ListPrice>
<Price>0.0100</Price>
<ListOneTimeCharge>0</ListOneTimeCharge>
<OneTimeCharge>0.0000</OneTimeCharge>
<ProductionHoursRequired>0</ProductionHoursRequired>
<DiscountedAmount>0</DiscountedAmount>
<DiscountedOneTimeChargeAmount>0</DiscountedOneTimeChargeAmount>
<OfferingRetirementDate xsi:nil="true" />
<OfferingExpirationDate xsi:nil="true" />
</RESTItemOfferingDetail>
<RESTItemOfferingDetail>
<OfferingId>cd83955d-2a00-4b90-9060-df82efce6f64</OfferingId>
<OfferingName>Black and White Printing</OfferingName>
<OfferingTypeId>a8d73b9c-4fd4-4e3e-b0e8-a019bc533679</OfferingTypeId>
<OfferingTypeName>Printing</OfferingTypeName>
<Quantity>5</Quantity>
<ListPrice>0</ListPrice>
<Price>0.0700</Price>
<ListOneTimeCharge>0</ListOneTimeCharge>
<OneTimeCharge>0.0000</OneTimeCharge>
<ProductionHoursRequired>0</ProductionHoursRequired>
<DiscountedAmount>0</DiscountedAmount>
<DiscountedOneTimeChargeAmount>0</DiscountedOneTimeChargeAmount>
<OfferingRetirementDate xsi:nil="true" />
<OfferingExpirationDate xsi:nil="true" />
</RESTItemOfferingDetail>
</ArrayOfRESTItemOfferingDetail>
</Details>
</ItemOfferingDetailGroup>
</OfferingDetails>
<Price>5.05</Price>
<OneTimeCharge>0.00</OneTimeCharge>
<Discount>0</Discount>
<Adjustment>0</Adjustment>
<OneTimeChargeDiscount>0</OneTimeChargeDiscount>
<OneTimeChargeAdjustment>0</OneTimeChargeAdjustment>
<DiscountAdjustment>0</DiscountAdjustment>
<OneTimeChargeDiscountAdjustment>0</OneTimeChargeDiscountAdjustment>
<ReferenceData>Testing</ReferenceData>
<Quantity>1</Quantity>
<ProductionHoursRequired>0</ProductionHoursRequired>
<LineItemFriendlyId>01-3060-00074-42850</LineItemFriendlyId>
</LineItemQuoteDetail>
</LineItemDetails>
<RecipientDetails>
<RecipientQuoteDetail>
<RecipientId>c87e21bd-fcce-4b0c-9c4a-378785f231c7</RecipientId>
<Tax>0.42</Tax>
<ExpectedShipDate>2019-09-26T22:59:59Z</ExpectedShipDate>
<ExpectedDeliveryDate>2019-10-01T22:59:59Z</ExpectedDeliveryDate>
<DeliveryCharge>13.27</DeliveryCharge>
<EstimatedPackageCount>1</EstimatedPackageCount>
<ReferenceData />
<DeliveryDiscount>0</DeliveryDiscount>
<DeliveryTax>1.53</DeliveryTax>
</RecipientQuoteDetail>
</RecipientDetails>
<OfferingDetails>
<OrderOfferingQuoteDetail>
<OfferingId>cca32f91-68d0-43f8-b6d5-1659a60ccbe3</OfferingId>
<Price>5.00</Price>
<OneTimeCharge>0.00</OneTimeCharge>
<Discount>0</Discount>
<OneTimeChargeDiscount>0</OneTimeChargeDiscount>
<PricingLevel>Order</PricingLevel>
<Quantity>1</Quantity>
<OfferingTypeId>17d19d65-655f-4eee-b7e4-5214a81267f7</OfferingTypeId>
<ProductionHoursRequired>0</ProductionHoursRequired>
</OrderOfferingQuoteDetail>
</OfferingDetails>
<DiscountDetails />
<CutoffDate>2019-09-25T02:00:00Z</CutoffDate>
<EarliestPossibleShipDate>2019-09-25T04:59:59Z</EarliestPossibleShipDate>
<EarliestExpectedDeliveryDate>2019-09-25T00:00:00</EarliestExpectedDeliveryDate>
<TotalEstimatedPackageCount>1</TotalEstimatedPackageCount>
<TotalProductionHoursRequired>0</TotalProductionHoursRequired>
<OrderFriendlyId>00-3060-00071-82085</OrderFriendlyId>
<Submitted>2019-09-24T09:40:12.164539Z</Submitted>
<Status>Submitted</Status>
<RecipientShippedPackageDictionary />
</OrderReceipt>
Code samples
@ECHO OFF
curl -v -X POST "https://print.api.mimeo.com/ord/Orders/PlaceOrder"
-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("Ocp-Apim-Subscription-Key", "{subscription key}");
var uri = "https://print.api.mimeo.com/ord/Orders/PlaceOrder?" + 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://print.api.mimeo.com/ord/Orders/PlaceOrder");
URI uri = builder.build();
HttpPost request = new HttpPost(uri);
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://print.api.mimeo.com/ord/Orders/PlaceOrder?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
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://print.api.mimeo.com/ord/Orders/PlaceOrder";
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:@"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://print.api.mimeo.com/ord/Orders/PlaceOrder');
$url = $request->getUrl();
$headers = array(
// Request headers
'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
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
})
try:
conn = httplib.HTTPSConnection('print.api.mimeo.com')
conn.request("POST", "/ord/Orders/PlaceOrder?%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
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.parse.urlencode({
})
try:
conn = http.client.HTTPSConnection('print.api.mimeo.com')
conn.request("POST", "/ord/Orders/PlaceOrder?%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://print.api.mimeo.com/ord/Orders/PlaceOrder')
request = Net::HTTP::Post.new(uri.request_uri)
# 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