Discussion
API
logging
Studio_Creatio
7.17

Hello Community,

 

Logging of incoming and outgoing API requests via Custom configuration services in Creatio is a very typical use case wherever system integration is in the picture. Logging the absolute URI, request/response body, response status code, any custom headers added to the request are standard in any enterprise system. 



I could not see any utilities or out of the box features to help log these requests. This is right now done by maintaining custom tables in the DB and logging any incoming or outgoing requests through custom logic.

 

The following features would help - 

  1. Logging inbuilt into the WebService element. It would help to have all outgoing requests using WebService elements be auto logged in the data base and be available for quick reference on the UI. An additional idea could be enabling a 'manual retry' option from the UI for use cases where an outgoing request failed  even after N number of configured retries.
  2. Utility or helper Classes on the server side which assist in tracking outgoing or incoming requests in the data base. A UI view of these logged requests could also help. Right now, we have to use 3rd party logging solutions like Loggly and write custom logic to maintain these logs.
4 comments

Hello!

 

Our R&D team has a problem registered on this topic on their side so to enable easy logging setup in the application UI for custom web-services and this problem is in the "Accepted" status so we can expect this logic implementation in one of the nearest releases. I will also let them know about this community idea so to speed up the problem solution.

 

Thank you for reporting this issue to us and helping us to make the application better!

 

Best regards,

Oscar

Oscar Dylan,

Thank you Oscar.

Oleg Drobina,

Hi Oleg is there any update on this feature ??

Hello,

Unfortunately, this task is not completed yet.

Best regards,
Ivan

Show all comments
attachments
studio
API
RESTAPI
file upload
file

Hi Team

I created a Node.js script to upload attachments using FileApiService.

Here is my script:

var axios = require('axios');

var fs = require('fs');

establish_connection();

 

async function establish_connection()

{

        axios.post('https://company_name.bpmonline.com/ServiceModel/AuthService.svc/Login',

        {

            "UserName":"xxxxxxx",

            "UserPassword":"xxxxxxxxxxx"

            

        }).then (function (response){

            console.log('Imported credentials cookie from BPM Online!')

            c=response.headers['set-cookie']

            var bpm_loader=c[0]

            bpm_loader = bpm_loader.replace('BPMLOADER=','')

            bpm_loader=bpm_loader.split(';')[0]

            var aspx_auth=c[1]

            aspx_auth = aspx_auth.replace('.ASPXAUTH=','')

            aspx_auth=aspx_auth.split(';')[0]

            var bpm_csrf=c[2]

            bpm_csrf = bpm_csrf.replace('BPMCSRF=','')

            bpm_csrf=bpm_csrf.split(';')[0]

            var user_name=c[3]

            user_name = user_name.replace('UserName=','')

            user_name=user_name.split(';')[0]

            var auth = 'BPMLOADER='+bpm_loader+'; .ASPXAUTH='+aspx_auth+'; BPMCSRF='+bpm_csrf+'; UserName='+user_name+';';

            console.log('Authentication Successful!')

            upload_attachments(auth,bpm_csrf)

        }).catch(error => {

            console.log(error)

        })

}

async function upload_attachments(auth,bpm_csrf) {

  let myPdf = fs.readFileSync("./file_name.pdf");

  let myData = myPdf.toString("base64");

 

  let myBody = {

    Name: "test.pdf",

    Data: myData,

    TypeId: '529bc2f8-0ee0-df11-971b-001d60e938c6',//This indicates that the type of the attachment is file

    Version: "1",

    Usr_reference_column_id: 'xxxxxguid_of_the_record_xxxxxxxx'

  };

 

  let options = {

    method: "POST",

    url: 'https://company_name.bpmonline.com/0/rest/FileApiService/Upload',

    headers: {

        "fileapi14998570381414":"",

      "cache-control": "no-cache",

      "Accept-Encoding": "gzip, deflate",

      "Cache-Control": "no-cache",

      Accept: "*/*",

      "Content-Type": "application/json;odata=verbose",

      Cookie:auth,

      BPMCSRF:bpm_csrf,

      "entitySchemaName":"Usr_id_of_the_file_section"

    },

    body: myBody,

    json: true

  };

 

  request(options, function(error, response, body) {

    if(!error)

    {

        console.log('Success!')

        console.log(response)

    }

    else

    {

        console.log('Failed!')

        console.log(error)

    }

  });

}

 

References: 

1. https://community.bpmonline.com/questions/sending-blob-file-node

2. https://community.bpmonline.com/questions/upload-files-case

3. https://community.bpmonline.com/questions/how-upload-attachments-odata

4. https://community.terrasoft.ru/questions/realizacia-peredaci-pdf-dokumenta-po-protokolu-odata-s-ispolzovaniem-http-zaprosov

5. https://community.terrasoft.ru/questions/fileapiservice-zagruzka-dokumenta-v-faily-i-primecania-crm-sistemy

 

I am able to establish connection (Authorization is successful) and getting SUCCESS for the attachment. But in the response, I am receiving 'Request Error'.

 

Questions:

1. Is my URL correct?

2. Is the way I specified file section name correct?

3. Do I need to add/delete/change my request body?

4. Do I need to create a MODULE in ADVANCED SETTINGS?

 

NOTE: I am using BPM'Online Studio.

Like 0

Like

1 comments

It's hard to say how it should be done on Node.js. However, there is an easy way to find if your request is correct. Please install "telerik fiddler" and catch the request that you send to bpm'online. For example, send file.jpg. Then open bpm'online and add the same file for example to a contact. Catch the request with fiddler too. Then compare those two requests. Your task is to create a functionality that will send exactly the same request. 

If you need an example on JS, please put a break point into the "upload" method in the ConfigurationFileApi module (in a browser) and add a file to a contact. You'll see how bpm'online generates the request. Please try to do the same on Node.js. 

Show all comments
lookup modal
lookup
API

Hi, 

In need to call an api and then show the result in a lookup modal for the user to select a result record. 

I have implemented the api call in a Business Process. I have implemented a button that opens a lookup modal. The problem is that I dont know how to make the lookup modal to get the results from the business process that calls the api. 

Regards,

 

Javier Turell 

Like 1

Like

3 comments

Dear Javier,

Since you are calling an external web service from business process, you need to parse a received reply and use the retrieved data to open a modal window.

Please see this article on how to parse a response from web service:

https://academy.bpmonline.com/documents/administration/7-14/setting-par…

As you will receive a response, parse it into separate business process parameters. Use auto-generated page or pre-configured page to display results to the user.

Regrads,

Anastasia

Can I show an selectable list on a auto-generated page or pre-configured page? I tryed to do that and I didnt find the way to do it. 

I would like to use the lookup modal to show the result and select a record, Is that posible? ​​​​​​



Regards, 

Javier

Javier Turell,

You can add any suitable page items of auto-generated page and pass it values from process parameter:

https://prnt.sc/nysad4

Regards,

Anastasia

Show all comments
Web-to-Object
API
developer

Hello, i am trying to integrate the form my friend have on his Wordpress website to the CMS.

Looked at the API Docs and found that Web-to-Object best suitable to what im trying to do.

Any way i dont have his credentials, i am build for him the function ready to put inside the wordpress, so i opened account (free for 14 days) only for this testing.

Thats what my json looks like:

The formId took from the landingId in the frontend script.

'formData' => [

                'formId' => '6c24a5e4-a08c-41c5-a868-19b49197a152',

                'formFieldsData' => [

                    ['name' => 'Contact', 'value' => 'Ohad Goldstein'],

                    ['name' => 'Contact.Mobile', 'value' => 'Ohad Goldstein'],

                    ['name' => 'Contact.JobTitle', 'value' => 'Ohad Goldstein'],

                    ['name' => 'Contact.Email', 'value' => 'Ohad Goldstein'],

                ]

            ]

to: https://008995-marketing.bpmonline.com/0/ServiceModel/GeneratedObjectWe…

I am always getting an error: 

{"SaveWebFormObjectDataResult":"{resultMessage:\"Not allowed request URL.\",resultCode:-1}"}

Even trying to request authenticate first (which succeed) -> grab the cookie -> and append him to this request header along with the BPMCSRF, and still this error.

I saw one old post with same error message and the respond was to update the domain to https://hooks....

But that was from zapier, what should i do for testing from my computer (localhost...) or later on when deployed the code and that will sent from the server ip probably.

One more question how can i edit the needed fields for the form in the admin panel ?

many of the form fields he want to pass does no configured in the leads table...

Thanks ahead

Like 0

Like

3 comments

Hello Ohad,



If you want to pass fields that are not present at "Lead" object, you should add them, so they will appear at "Lead" table. You should use object designer: https://academy.bpmonline.com/documents/technic-sdk/7-13/workspace-object-designer



In your case I recommend to create a simple landing page as it is described in article: https://academy.bpmonline.com/documents/technic-sdk/7-13/creating-web-case-landing-pages



Then, catch the query that is sent to the bpm'online (in network tab in devtools or Fiddler). The function that you are trying to create, should perform similar query.



Development process is more convenient when you have a system that is deployed on your local machine: https://academy.bpmonline.com/documents/administration/7-13/deploying-bpmonline-application-site



Regards,

Alex 

Alex_Tim,

Hey Alex,

Thanks for the answer,

Where is that "The object designer workspace" located for creating my own custom objects ?

I think i was wrong for trying to use the Web-To-Object request, i am trying to send that request from the server side; i am getting success message when using the  "/0/dataservice/json/reply/InsertQuery" request. Am i right about this ? or still should use the "Web-To-Object"..

Ohad Goldstein,



Hello, dataservice (as well as entitydataservice) can be used for integration with bpm'online. InsertQuery request is used for creating entities. Feel free to use the dataservice as you wish. 



You can find designer in advanced settings menu in system designer. http://prntscr.com/n7vbs4



Regards,

Alex

Show all comments
API
Customization
7.13_()
customer_center

How to access user / custom field through API? I'm using OData/WCF data access

 

Like 0

Like

6 comments

Dear Lj,

Please see this academy article which describes how to work with fields using OData https://academy.bpmonline.com/documents/technic-sdk/7-13/working-bpmonl…. This article also contain examples that can be used.

Best regards,

Oscar

This shows how to access standard fields and it works ok, but I've added custom fields (user fields) on Accounts, there is no showcase how to do that? Or am I missing something?

Hello Lj, 



You should work with custom fields that you have added to Account object in same way like you do it with standard fields.



Best regards,

Alex

Alex_Tim,

then there is some step that I'm not doing - WSDL generated from my instance does not contain my custom field

Lj,

Please make sure that you compiled the system after making changes to Account object.



Best regards,

Alex

 

Alex_Tim,

Thanks! That was the solution!

Show all comments
API
web api
7.12_()
studio

Hi community!

How are you?

Any example for call a API Rest from c# script in a businessProcess?

 

I have a list of processes to call from a detail, one of them must call an API and process the response but I can not use the "Call Web service" element because the request needs a json structure with many nests and I can not complete it in any other way that is not a script, any suggestions?

King Regards,

 

Ezequiel

Like 0

Like

1 comments



Dear Ezequiel,

Configuring the method for "Call web service" business process parameter please use quick setup:

In this case, for example, if you provide the JSON with a nested element or even with a nested array:

The system will automatically configure correct JSON paths:

Afterward, choosing this method in "Call web service" business process parameter, you will be able to fill in any nested parameter:

The only thing that may be uncomfortable for now is that for the nested array you can fill only the first element.

In case you need to fill a bunch of the array elements please try to use any synchronous C# methods in scrip-task instead, for example, the first answer in this topic may work for you: https://stackoverflow.com/questions/9145667/how-to-post-json-to-a-server-using-c

Regards,

Anastasia

Show all comments

I use the OData to extract the data. I need to get cases with the specific status from the CaseCollection. To do this I use the following Http-request:

https://company.bpmonline.com/0/ServiceModel/EntityDataService.svc/Case… eq guid'7e9f1204-f46b-1410-fb9a-0050ba5d6c38'.

But I recieve the "404 ERROR

1

Элемент коллекции с именем StatusId не найден " (The element  StatusId is not found").



But if I do https://company.bpmonline.com/0/ServiceModel/EntityDataService.svc/Case…;

it responses with 200 OK.



How to retrieve cases with the specific StatusId from CaseCollection? 

Like 0

Like

1 comments

Hello Timur,



The Status column in the Case table is the foreign key for CaseStatus table. Therefore, the correct syntax is the next: [Name_of_joinable_table / Name_of_column_for_linking_of_joinable_table].

In your example it will be: https://ticketland.bpmonline.com/0/ServiceModel/EntityDataService.svc/C… eq guid'7e9f1204-f46b-1410-fb9a-0050ba5d6c38'.

Show all comments
API
7.12
sales_enterprise

Hello, 

We have an API that we are trying to grab information from and show the information on a detail on the edit page. We are already the API is working and we are getting a response, however we are not sure how to now display the data on the detail. 

(We are using a detail because on the edit page we are grabbing a new values and passing them through parameters for a query done on the other server getting the API call.) 

Do you have any thought on this? We looked into virtual columns/tables but were unsuccessful.  

Like 0

Like

1 comments

Hello Philip,

So, you have a REST-service and you are looking for a way to display the response from it on some detail on the edit page. Do I understand you correctly?

The best way to achieve this goal is create a business process. Please, take a look on the [Call web service] process element.

You can find all needed information and examples on our academy web-site - https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv…

Also, you will find an example of setting up web service integration following this link - https://academy.bpmonline.com/documents/technic-bpms/7-12/calling-web-s…

Show all comments
API
integration
7.11
studio

I was wondering if there are working projects of the different public integration methods out there in the community before I reinvent the wheel; besides what is in the development manual, like on GitHub or on this site. I'm looking for actual Visual Studio projects or solutions; boilerplate if you will.  I'm only interested in integration, not BPM customization.  

Second question, where do you find the latest Terrasoft assemblies, if you are working with the cloud version only, not on premise. 

Thanks everyone.

Like 1

Like

1 comments

The project in the article by the link below is working properly. I tested it last month.

https://academy.bpmonline.com/documents/technic-sdk/7-11/working-bpmonl…

Additionally, please check how to track the integration with fiddler. This will help you a lot.

https://academy.bpmonline.com/documents/technic-sdk/7-11/executing-odat…

If you need bpm'online on-site, please email to support@bpmonline.com 

Please note that you will not be able to open bpm'online solutinon in VS, build it and run. Bpm'online is not OpenSource. However, on-side installation allows attaching visual studio and debugging. 

Show all comments
mnet
MuleSoft
Zapier
RESTful
integration
API
DataServices
7.11
sales

Has anyone been able to use integration SaaS solutions such as Zapier or MuleSoft with bmp'online?  I realize the bmp'online is RESTful and may require some additional effort.  I am mostly focused on a one-way sync to create leads.   Hoping to find a way to hit the DataServices side of bmp'online.

Like 0

Like

1 comments

Dear Stephen,

We already have the suggestion to add the out-of-the-box integration with the services registered and passed to the appropriate team. It will be taken into consideration for the further releases. 

At the moment the integration can be created via OData/DataService in case the mentioned services have the open API. 

Lisa

Show all comments