You can use the Manufacturer for Pharma API to integrate the third-party systems with the Manufacturer for Pharma application.


The Manufacturer for Pharma API uses the Representational State Transfer (REST) standard to interact with other systems.


The Manufacturer for Pharma API is an extension of the Manufacturer for Pharma application of Movilitas.Cloud and enables you to send requests from external systems to the application.


This article describes how to send a Foreign MDLP request to Movilitas.Cloud by using the Manufacturer for Pharma API. The data you send in the request is forwarded to the MDLP system.


Note: The data you send must be an MDLP XML message encoded in Base64 format.


API Tool to Use


In this document, we provide examples by using the cURL command-line tool. You can use any API tool to perform the API requests, for example, Postman or Katalon Studio.


Before You Begin


Before you start sending any messages:


1. You must enable the Manufacturer for Pharma application in the Admin UI.

2. You must create an API key and secret. 

3. You must create a shopfloor channel with Manufacturer API source. You will need the channel key for your requests.

4. You must configure the Manufacturer for Pharma application and the channels required to connect to external systems.

5. You must have the authentication token to send requests over API. Select one of the following ways:

  • Apply a dynamic token. Send an authentication request over the Authentication API. For more information about the Authentication API, open the Tenant Dashboard in Movilitas.Cloud, select API keys, and choose Authentication API Documentation. Also, see Authentication Request.
  • Apply a static token. Generate a static token for your previously created API key.


For more information, see Configuring the Movilitas.Cloud APIs.


Procedure


1. Use the POST method and the following URL:


https://api.movilitas.cloud/v1/manufacturer/v1/api/mdlp_foreign_send


2. For the header, define the following:


KeyAction
Content-TypeApply JSON format for the content. Use the value application/json.
x-access-tokenProvide the authentication token.


3. In the body of the request, define the parameters and their values based on the table below.


FieldRequired or Optional?TypeDescription
channel_keyRequiredStringThe channel key of your Manufacturer for Pharma API channel. 
mdlp_channel_keyRequiredStringThe channel key of the MDLP Foreign channel in Movilitas.Cloud.

To retrieve the channel key, open the Admin UI, go to Tenant Dashboard --> Channels tab, and open the MDLP Foreign channel for editing. You can find the channel key at the top of the Edit business channel panel.
dataRequiredStringbase64 encoded xml data


4. Send the request.



Sample cURL Request


curl -X POST \
  https://api.movilitas.cloud/v1/manufacturer/v1/api/mdlp_foreign_send \
  -H 'Content-Type: application/json' \
  -H 'x-access-token: ' \
  -d '{
    "channel_key": "FTP7DDH1EBMRZV8zdazTGvXXzfdgth1h43rXFDg1",
    "mdlp_channel_key": "WwunYoltWdAfB0xds4QQh4vldc417G4rjXejosO4",
    "data": "PGRvY3VtZW50cyB2ZXJzaW9uPSIxLjE2IiA+DQoJPHF1ZXJ5X2tpel9p bmZvIGFjdGlvbl9pZD0iMjEwIj4NCgkJPHN1YmplY3RfaWQ+MDAwMDAwMDAwMDA1NjE8 L3N1YmplY3RfaWQ+DQoJCTxzZ3Rpbj4xMTE3MDAxMjYxMDE1MTAwMDAwMDAwYTAwMTE8 L3NndGluPg0KCTwvcXVlcnlfa2l6X2luZm8+DQo8L2RvY3VtZW50cz4="
}'


Sample Response (Success 200)


{
   "success": true,
   "message": "Data sent on foreign endpoint",
   "data": "8d0d9c80-207d-48d1-a02c-40faba999f79"
}