Testing OpenAPI integration

29 views
Skip to first unread message

Lina Maria Avendaño Carvajal

unread,
Aug 14, 2020, 9:58:08 PM8/14/20
to Syndesis
Hello Community!

I'm a business analyst user trying to use syndesis to create integrations using OpenAPI connectors and excelsheets. So far I have been able to create an excelsheet connector and API client connector, and make a timer simple integration like GET the user logged in. I'm particularly interested in making an integration between my ERPNext instance and excelsheet to create business reports.

However, I have reached out the point where, using this ERPNext OpenAPI, I cannot use other calls like GET /api/resource/{DocType} that gets a list of documents, because I can't find a way to indicate the DocType parameter through syndesis integration steps. I see that maybe this is related to the properties that need to be configured per action:


Could anyone please guide me or tell me whether I'm being mistaken in my approach, I have already watched all available tutorials available related to this matter but I cannot find a clue. Where or how should I indicate parameters per action?

Really appreciate any response.

BR,

Lina Avendaño

Zoran Regvart

unread,
Aug 15, 2020, 4:10:39 AM8/15/20
to Lina Maria Avendaño Carvajal, Syndesis
Hi Lina,
the value from the parameter needs to come from a step preceding the
API client step, and the timer doesn't output any value. In this
scenario you could add a mapping step in between the timer and the API
client and use create a constant to map to the `DocType` parameter.

Similarly how I've done it here for the `studentId` parameter (see attachment).

zoran


On Sat, Aug 15, 2020 at 3:58 AM Lina Maria Avendaño Carvajal
<lina...@gmail.com> wrote:
>
> Hello Community!
>
> I'm a business analyst user trying to use syndesis to create integrations using OpenAPI connectors and excelsheets. So far I have been able to create an excelsheet connector and API client connector, and make a timer simple integration like GET the user logged in. I'm particularly interested in making an integration between my ERPNext instance and excelsheet to create business reports.
>
> However, I have reached out the point where, using this ERPNext OpenAPI, I cannot use other calls like GET /api/resource/{DocType} that gets a list of documents, because I can't find a way to indicate the DocType parameter through syndesis integration steps. I see that maybe this is related to the properties that need to be configured per action:
>
>
> Could anyone please guide me or tell me whether I'm being mistaken in my approach, I have already watched all available tutorials available related to this matter but I cannot find a clue. Where or how should I indicate parameters per action?
>
> Really appreciate any response.
>
> BR,
>
> Lina Avendaño
>
> --
> You received this message because you are subscribed to the Google Groups "Syndesis" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syndesis+u...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/syndesis/9aefa2dd-7589-4008-b1f1-fbb6d4e2bed2o%40googlegroups.com.



--
Zoran Regvart
Screenshot_2020-08-15 Data Mapper - Syndesis.png

Lina Maria Avendaño Carvajal

unread,
Aug 15, 2020, 10:12:20 PM8/15/20
to Syndesis
Dear Zoran,

Thank you a lot!!! It worked, finally. (I've spent a lot of time doing unsuccessful tests).

Now that I have step ahead, I've found a new obstacle. I would really appreciate if you can help me again.

Using the same ERPNext OpenAPI that I mentioned before I get fields and filters, which appear to be collections in syndesis. I applied the same logic you explained with the DocType as a constant so I pointed out a field Gender also as a constant, however, this is not working. According to the explanation in the OpenAPI Please see image attached. I guess fields collections shouldn't be treated this way but I don't see any other option.


I'm really thankful for your help.

BR,

Lina

El sábado, 15 de agosto de 2020, 3:10:39 (UTC-5), Zoran Regvart escribió:
Hi Lina,
the value from the parameter needs to come from a step preceding the
API client step, and the timer doesn't output any value. In this
scenario you could add a mapping step in between the timer and the API
client and use create a constant to map to the `DocType` parameter.

Similarly how I've done it here for the `studentId` parameter (see attachment).

zoran


On Sat, Aug 15, 2020 at 3:58 AM Lina Maria Avendaño Carvajal
<lina...@gmail.com> wrote:
>
> Hello Community!
>
> I'm a business analyst user trying to use syndesis to create integrations using OpenAPI connectors and excelsheets. So far I have been able to create an excelsheet connector and API client connector, and make a timer simple integration like GET the user logged in. I'm particularly interested in making an integration between my ERPNext instance and excelsheet to create business reports.
>
> However, I have reached out the point where, using this ERPNext OpenAPI, I cannot use other calls like GET /api/resource/{DocType} that gets a list of documents, because I can't find a way to indicate the DocType parameter through syndesis integration steps. I see that maybe this is related to the properties that need to be configured per action:
>
>
> Could anyone please guide me or tell me whether I'm being mistaken in my approach, I have already watched all available tutorials available related to this matter but I cannot find a clue. Where or how should I indicate parameters per action?
>
> Really appreciate any response.
>
> BR,
>
> Lina Avendaño
>
> --
> You received this message because you are subscribed to the Google Groups "Syndesis" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to synd...@googlegroups.com.

Zoran Regvart

unread,
Aug 18, 2020, 4:34:38 AM8/18/20
to Lina Maria Avendaño Carvajal, Syndesis
Hi,
I think that the value of constant is set verbatim. This could either be a bug in Syndesis or Atlasmap, or in the mapping step transformation needs to be added to split the constant’s value into a collection.

I’d look in the activity tracking or adding log steps to inspect the message body to find out what happens exactly.

zoran
-- 
Sent from mobile

On 16. Aug 2020, at 04:12, Lina Maria Avendaño Carvajal <lina...@gmail.com> wrote:


Dear Zoran,

Thank you a lot!!! It worked, finally. (I've spent a lot of time doing unsuccessful tests).

Now that I have step ahead, I've found a new obstacle. I would really appreciate if you can help me again.

Using the same ERPNext OpenAPI that I mentioned before I get fields and filters, which appear to be collections in syndesis. I applied the same logic you explained with the DocType as a constant so I pointed out a field Gender also as a constant, however, this is not working. According to the explanation in the OpenAPI Please see image attached. I guess fields collections shouldn't be treated this way but I don't see any other option.

<Auto Generated Inline Image 1>
To unsubscribe from this group and stop receiving emails from it, send an email to syndesis+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/syndesis/0b508884-9ad5-45dc-a80f-ac7da9cd687do%40googlegroups.com.
<Auto Generated Inline Image 1>

Lina Maria Avendaño Carvajal

unread,
Aug 19, 2020, 8:39:01 PM8/19/20
to Syndesis
Indeed name fields can be registered as constants and mapped as fields (collection).  This works properly, the api calls the fields indicated (/api/resource/Employee?fields="name,company,gender"). But, how is it exactly that I can execute the 2nd mapping to get fields infomation into the excelsheet? I've tried to get the fields information by mapping fields (collection) to any column in the excelsheet, but this doesn't work and I assume it's because I'm trying to do it from the request and should be from the response, but in the response I have nothing else than a "name" field that comes from the api.

Really appreciate any help.

BR,

Lina
screenshot-syndesis-myproject.192.168.42.44.nip.io-2020.08.19-19_37_35.png

Zoran Regvart

unread,
Aug 20, 2020, 5:15:52 AM8/20/20
to Lina Maria Avendaño Carvajal, Syndesis
Hi,
I had a quick look at the OpenAPI specification, seems that the authors defined the response as generic DocList:


And by that the response only contains the `name` property. Syndesis and by extension AtlasMap, can’t know that different document types result in different response bodies, and we can only specify the data shape according to the given API specification. And OpenAPI doesn’t have any notion of polymorphism, so it’s difficult to achieve this within the specification. 

I think you have two options: edit/create a API specification so that it specifies response with the fields you need, i.e. be specific; or create a step extension that would set the desired data shape (not sure if convert-body can be used for this). 

zoran
-- 
Sent from mobile

On 20. Aug 2020, at 02:39, Lina Maria Avendaño Carvajal <lina...@gmail.com> wrote:


To view this discussion on the web, visit https://groups.google.com/d/msgid/syndesis/8997c0b3-1ae0-4b57-9166-c840a9cb16c3n%40googlegroups.com.
<screenshot-syndesis-myproject.192.168.42.44.nip.io-2020.08.19-19_37_35.png>
Reply all
Reply to author
Forward
0 new messages