application connector operations

   

proiv dashboard  

RESTful Web Services Demo

The demo uses the Restful Web Service definition PROIV Demo Service and makes call to an example PROIV crm database.

To make calls to the web service select the restful method and click the Send button.

RESTful Web Services Demo Configuration

To set the RESTful Web Services Demo configuration, do the following:

  1. On the Application Connector Operations page, expand RESTful Web Services Demo.
    The Application Connector operations page appears.

  2. Enter the configuration as required. The following table describes the fields that can be configured.

    Field Name

    Description

    Options

    Authorization

    Security id

    Enter the security id. Setting the security id enables HTTP access security on the service. The server sends the text to the client requesting the service, and the client needs to respond with the security secret specified in the next field.

    Secret

    Enter the secret text that the HTTP client needs to respond with if there is a security id. If there is no security id, this field is ignored.

    CORS

    Enable CORS

    Cross-origin resource sharing (CORS) defines a way for client web applications that are loaded in one domain to interact with resources in a different domain.

    Turn ON the slider for Enable CORS to enable the service. If this is not set, the service is not available. If you set and save the service it might be auto disabled where a red indicator appears. Click the red indicator to view the message that explains the reason for being auto disabled.

    Note: If a REST service has both CORS and authorization (security ID & secret) enabled, the CORS Options request must include authorization. If this is not required then authorization for an Options request can be turned off by setting the servlet parameter 'restful_options_needs_authorization' to 'false' in the WebServices web.xml file.

    By default, CORS is disabled.

    Headers

    Enter the request header name for the service to accept; in case of multiple headers, separate the headers with a comma. A request header name defines a name that the service will accept in the request header called 'Access-Control-Request-Headers' for a CORS pre-flight request. The request headers that were accepted will be returned in the response header ‘Access-Control-Allow-Headers’ for the CORS pre-flight request.

    A service does not need to use any headers, hence the field can be left blank but if a CORS pre-flight request does specify headers in the ‘Access-Control-Request-Headers’ header, then these must be defined in this field or an error status will be returned as stated in the Failed Status Responses.

    Note: The ‘Authorization’ header used by the PROIV REST server is automatically included in the list of acceptable request headers so does not need to be defined here.

    Asynchronous

    Asynchronous

    Turn ON the slider for Asynchronous to execute the REST service asynchronously.

    HTTP Request Method

    Method

    Select a method. Refer to RESTful Web Service methods for more information.

    By default, GET method is selected.

    Request Data

    Description

    Method Request

    ContactId

    Contact Id is mandatory except for POST and represents the unique indentifier of the contact created in the crm database. This has a maximum entry of 8 numeric characters. It is generated automatically for a new contact with next available number for the ContactIdId (POST) and is formatted with leading zeros e.g. '00000010'.

    PATCH, GET, PUT & DELETE

    ContactName

    Represents the full name of the contact created in the crm database and is free format text. Contact name is mandatory for a new contact and can be a maximum of 80 characters.

    POST & PUT

    ContactCompany

    Represents the company name of the contact created in the crm database and is free format text. Contact company is mandatory for a new contact and can be a maximum entry of 50 characters.

    POST & PUT

    ContactTitle

    Represents the title of the contact created in the crm database e.g. 'Ms' and is free format text. The title can be a maximum entry of 10 characters.

    POST & PUT

    ContactEmail

    Represents the email address of the contact created in the crm database and is free format text. This email address is mandatory for a new contact, if ContactPhone is left blank, and can be a maximum of 250 characters. Both ContactPhone and ContactEmail can be entered together if required.

    POST, PATCH & PUT

    ContactPhone

    Represents the company telephone number of the contact created in the crm database and is free format text. This phone number is mandatory for a new contact, if ContactEmail is left blank, and can be a maximum of 20 characters. Both ContactPhone and ContactEmail can be entered together is required.

    POST, PATCH & PUT

    ContactStatus

    Represents the status of the contact created in the crm database and is free format text and is validated against a table of valid statuses (CRMDemo_Status). Contact status is mandatory for a new contact and can be a maximum entry of 20 characters. Valid examples are 'Archive', 'Lead', 'Opportunity' and 'Won'.

    POST & PUT

    ContactProject

    Represents the project associated with the contact created in the crm database and is free format text. Contact project is mandatory for a new contact and can be a maximum entry of 50 characters.

    POST & PUT

    ContactDate

    Represents the date allocated to the contact created in the crm database and is formated 'YYYY/MM/DD'. Contact date is mandatory for a new contact.

    POST, PATCH & PUT

    NotesStatus

    Represents the status of the notes associated with a contact created in the crm database and is free format text. Notes status is optional and can be a maximum entry of 20 characters. Valid entries include 'Completed' and 'Pending'.

    POST

    NotesDescription

    Represents a description of the notes allocated to the contact created in the crm database. Contact description is mandatory and has a maximum entry of 20 characters. Valid entries include 'Demo', 'Follow up Email', 'Meeting' and 'Phone Call'.

    POST

    NoteIsToDoType

    Represents note is to do type allocated to the contact created in the crm database. Notes is to do type is mandatory for a new contact and is validated against a table of to do types (DEMOCRM_To_Do_Type). NotesToDoType is mandatory for a new contact and can be a maximum entry of 20 characters. Valid entries include 'Meeting' and 'Task'.

    POST

    NotesText

    Represents the notes associated with a contact created in the crm database and is free format text. Contact notes is mandatory for a new contact and can be a maximum entry of 250 characters. When a new note is added it is associated with the contact and has a unique note Id number genrated in the same format as contact Id.

    POST

    NotesToDueDueDate

    Represents the notes to do due date allocated to the a contact's notes created in the crm database and is formated 'YYYY/MM/DD'. Notes due date is optional.

    POST

    NoteIsToDo

    Represents notes is to do against a contact created in the crm database. Notes to do is true or false and defaults to true.

    POST

    NotesEntryDate

    Represents the date allocated to the a contact's notes created in the crm database and is formated 'YYYY/MM/DD'. Notes entry date is mandatory for a new contact.

    POST

    URL

    Endpoint

    The URL is created automatically with the specified ContactId value.

    The URL is recognized by the server as a request for a RESTful Service. This can be any text but must start with "/". If you do not put "/" at the beginning, the "/" gets added automatically when the service is saved.

    Click Send to execute the REST call.

    Response

    Status

    The path is the last part of a URL that will be recognized by the server as a request for a RESTful Service. This can be any text but must start with "/". If you do not put "/" at the beginning, the "/" gets added automatically when the service is saved.

    Response Body

    A service method may define the acceptable responses for a service call. You can create as many responses as you want and you do not have to define any responses.

    You can define the body data for a service method which requires request body data when it is called. Only methods of type ‘post’, ‘put’ or 'patch' can define a request body. This body field defines a JSON schema for the request body content and this schema will be used by the test panel and the client generation tool to provide some checking that the request body has the correct structure before a call to the service is performed.

    To help in schema generation you can enter an actual JSON object and click ‘{o}->{s}’ on the right of the field and it will convert your JSON object to a valid JSON schema.

RESTful Web Services Test

Any Restful web services that have been defined in the configuration settings will be available for testing here once the configuration has been deployed.

As an example, to test the RESTful Web Services Demo configuration, do the following:

To test the RESTful Web Services CRM Demo configuration, do the following:

  1. On the Application Connector Operations page, expand RESTful Web Services Test.
    The PROIV CRM Demo Service section appears.

    Field Name

    Description

    Use secure protocol

    Turn ON the slider to use secure protocol (HTTPS). If the slider is turned OFF, the service will use HTTP protocol.

    PATCH

    Enter the unique Contactid and type in any values that you want to change. You do not need to give values for every field when using patch. Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the PATCH method of RESTful Web Service configuration.

    POST

    Enter the values for the fields ContactTitle (mandatory), ContactName (mandatory), ContactPhone (mandatory if ContactEmail not entered), ContactEmail (mandatory if ContactPhone is not entered), ContactCompany (mandatory), CompanyAddress 1 to 4 (optional), CompanyPostcode (optional), ContactProject (mandatory), ContactStatus (mandatory) and ContactDate (mandatory in format 'YYYY/MM/DD'). Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the POST method of RESTful Web Service configuration.

    GET

    Enter the value for the field ContactId which is mandatory and is a unique identifier for CRM contact. Click Test to test the service with the configured contact id. The response is displayed under the Response section with the response code and description as you have set in the GET method of RESTful Web Service configuration.

    DELETE

    Currently unavailable. Enter the unique ContactID. Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the DELETE method of RESTful Web Service configuration.

    PUT

    Enter the values for the fields such as Contactid (mandatory for updating contact details), ContactTitle, ContactName, ContactPhone, ContactEmail, ContactCompany, ContactAddress 1-4 and CompanyPostcode with similar validation to POST. All mandatory fields are required for a new contact in PUT. Click Test to test the service with the configured values. It will update details if found for the Contactid or create a new entry if the Contactid does not exist. The response is displayed under the Response section with the response code and description as you have set in the PUT method of RESTful Web Service configuration.

  2. Set the configuration as required. The following table describes the fields that can be configured.

SOAP WSDL

To set the SOAP Web Services Demo configuration, do the following:

  1. On the Application Connector Operations page, expand SOAP WSDL.
    The SOAP services that are configured are displayed. The Demo Web Service appears by default.

  2. The following table describes the fields that helps use the service for the selected web service.

    Field Name

    Description

    Use secure protocol

    Turn ON the slider to use secure protocol (HTTPS). If the slider is turned OFF, the service will use HTTP protocol.

    Endpoint

    The URL is created with the specified configuration settings. You can not change the URL as it s read-only. The URL is recognized by the server as a request for a SOAP Service. This can be any text but must start with "/". If you do not put "/" at the beginning, the "/" gets added automatically when the service is saved.

    WSDL

    Enter WSDL URL to get a web page. You can use the URL to see the XML that is generated for the web service when executed by a service client.
    Note: The WSDL URL can be used by an external web services client to collect the WSDL and execute the services.

Related Topics

Dashboard Overview


 

Comment on this topic

Topic ID: 830005