Processing Api using tRestclient

Highlighted
Four Stars

Processing Api using tRestclient

Hi All,

As I'm new to Talend,forgive me to ask newbies questins Smiley Happy ,I'm developing now a talend job on ESB 7.3  to load data from api to postgres DB :

 

API json file response as follows:

{
    "content": [
        {
            "id"25628,
            "type""NPS",
            "filledOut"true,
            "locale""fr-FR",
            "createdAt""2020-04-01T12:52:45.728Z",
            "modifiedAt""2020-04-01T12:52:45.728Z",
            "encryptedCaseId""371655fb2bb544fcf5607d8aa2ea13e7",
            "survey_questions": [
                {
                    "rating"4,
                    "createdAt""2020-04-01T12:56:49.733Z",
                    "modifiedAt""2020-04-01T12:56:49.733Z",
                    "question""4. Comment évalueriez-vous l\\'amabilité de notre service?",
                    "isfreetext"false,
                    "freetext"null
                },
                {
                    "rating"5,
                    "createdAt""2020-04-01T12:56:49.733Z",
                    "modifiedAt""2020-04-01T12:56:49.733Z",
                    "question""5. Avez-vous eu l\\'impression d\\'avoir été bien informé de l\\'évolution de votre dossier?",
                    "isfreetext"false,
                    "freetext"null
                },
                {
                    "rating"4,
                    "createdAt""2020-04-01T12:56:49.733Z",
                    "modifiedAt""2020-04-01T12:56:49.733Z",
                    "question""6. Avez-vous recommandé notre service à d\\'autres personnes?",
                    "isfreetext"false,
                    "freetext"null
                },
           attached the job flow and schemas used, when i run the job i received below error in tExtractJSONField_1

 

org.talend.designer.runprocess.ProcessorException: Job compile errors
At least job "nps_restclient" has a compile errors, please fix and export again.
Error Line: 1829
Detail Message: Invalid character constant
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
at org.talend.designer.runprocess.JobErrorsChecker.checkLastGenerationHasCompilationError(JobErrorsChecker.java:358)
at org.talend.designer.runprocess.DefaultRunProcessService.checkLastGenerationHasCompilationError(DefaultRunProcessService.java:539)
at org.talend.designer.runprocess.RunProcessService.checkLastGenerationHasCompilationError(RunProcessService.java:317)
at org.talend.designer.runprocess.ProcessorUtilities.generateBuildInfo(ProcessorUtilities.java:955)
at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:615)
at org.talend.designer.runprocess.ProcessorUtilities.generateCode(ProcessorUtilities.java:2068)
at org.talend.designer.runprocess.RunProcessContext$1.run(RunProcessContext.java:601)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:440)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:356)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:474)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:240)
at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:966)
at org.talend.designer.runprocess.RunProcessContext.exec(RunProcessContext.java:548)
at org.talend.designer.runprocess.ui.ProcessComposite.exec(ProcessComposite.java:1448)
at org.talend.designer.runprocess.ui.views.ProcessView$RunAction.run(ProcessView.java:700)
at org.talend.designer.runprocess.ui.actions.RunProcessAction.run(RunProcessAction.java:63)
at org.talend.designer.core.debug.JobLaunchConfigurationDelegate$1$1.run(JobLaunchConfigurationDelegate.java:98)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3919)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3550)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
at org.talend.rcp.intro.Application.start(Application.java:280)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)

Tags (1)
Highlighted
Sixteen Stars
Sixteen Stars

Re: Processing Api using tRestclient

To be sure the line on error, click on Code tab, then click the click the red rectangle on the right margin to reach the line. Move the mouse pointer over the cross in the left margin to display the error message.
You can also try to change \\' by a single ' in the json.

TRF

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read