Skip to content
+1-888-319-3663

COMMUNITY FORUM

Question about SmartConnect’s Webs Service Connector

alexvilper asked 7 years ago

I know that we can have SmartConnect gather data from Miscrosoft CRM and dump it into a SQL database (and use some other in-house written application to process that data), because we already do that. Right now I am researching the possibility of having SmartConnect gather data from CRM and use the Web Service Connector to post the data directly to the Zendesk API.  
 
?I am going through the documentation for SmartConnect, and I am not sure whether or not it can handle dynamically created API url's and authentication – I could not find anything stating that it can. 
 
?For instance, creating an user in Zendesk with the API is done like this:
 
curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users.json 
  -H "Content-Type: application/json" -X POST -d '{"user": {"name": "Roger Wilco", "email": "roge@example.org"}}'
And updating would be like this:
 
curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users/{id}.json 
  -H "Content-Type: application/json" -X PUT -d '{"user": {"name": "Roger Wilco II"}}'
Note the {id} field, which should be dynamically placed in the API URL.
 
Based on the documentation for creating the Web Service Connector, it does not look like SmartConnect can handle this type of API configuration. Is this assessment correct? If not, could you please point me to some documentation or send me some information on how this can be accomplished?

Thanks!

 

alexvilper replied 7 years ago

Not sure what happened to those two blocks. They look fine if you click on "Reply" or "Quote"..

alexvilper replied 7 years ago
Since there is no option to update a post, here are the two blocks that are messed up on the original post – they showed up OK on the post preview:

 

curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users.json 
  -H "Content-Type: application/json" -X POST -d '{"user": {"name": "Roger Wilco", "email": "roge@example.org"}}'

 
curl -v -u {email_address}:{password} https://{subdomain}.zendesk.com/api/v2/users/{id}.json 
  -H "Content-Type: application/json" -X PUT -d '{"user": {"name": "Roger Wilco II"}}'
Note the {id} field, which should be dynamically placed in the API URL.

 
 

Answers
Best Answer
lorren answered 7 years ago
Alex,

You are correct, SmartConnect is not able to use dynamically generated URL's for the Web Service Data Source or Destination.

However, you can always use a Script Task to accomplish what you are needing to do. You can use a Pre-Map task to call a web service and pull data into a file. You can also use a post document task to send data to a web service using a script task.

Lorren
alexvilper replied 7 years ago

Hi Lorren,

Thanks for the reply. 
Are there any samples (somewhere) of how to use the script task to accomplish this?

Thanks!

lorren replied 7 years ago

Here is a link to a codeproject solution that discusses how you would call the Zendesk API.

http://www.codeproject.com/Tips/782726/Getting-Tickets-Information-from-Zendesk-API

Each script task within smartconnect is really a method and executes at a specific time within the SmartConnect process. The Pre-Map tasks run before SmartConnect even reads the data source.

Here is an example of pulling data from an FTP site in the Pre-Map stage that you could extrapalate to your Zendesk script.

http://blog.eonesolutions.com/2014/06/tech-tuesday-creating-task-in.html

Thanks,
Lorren

alexvilper replied 7 years ago

Hi Lorren,

Thank you very much for the reply. I will review the links.

Cheers!

Beat Bucher answered 3 years ago
Hi Lorren,
The link you provided above for the Tech Tuesday blog post is no longer good… By any chances do you have another example ? I need to figure out how to run a JSON script to query a web API service from Expensify to retrieve a report format and download expense data in order to get them processed by a map in SC 2018 and upload the payable transaction into GP .. 
Ethan Sorenson Staff replied 3 years ago

Beat,<br>Here is the new link to the Tech Tuesday article.<br>https://www.eonesolutions.com/tech-tuesday-creating-a-task-in-smartconnect-to-get-a-file-from-an-ftp-site/<br><br>Here is an example of a task that makes a web call to return a JSON output, which can be written to a file if needed.<br>https://www.eonesolutions.com/tech-tuesday-how-to-handle-paging-with-shopify-in-smartconnect/


If you would like to submit an answer or comment, please sign in to the eOne portal.