Giter Site home page Giter Site logo

jundis / cwslack-slashcommands Goto Github PK

View Code? Open in Web Editor NEW
54.0 19.0 20.0 491 KB

Retrieve ConnectWise information into Slack channels and DMs

License: GNU General Public License v3.0

PHP 100.00%
php-files connectwise slack slack-commands ticket-information

cwslack-slashcommands's Introduction

CWSlack-SlashCommands

This script, when hosted on a PHP supported web server, will act as a bridge between the JSON requests of Slack and the JSON responses of the ConnectWise REST API.

cwslack.php, cwslack-incoming.php, cwslack-activities.php, cwslack-configs.php, and cwslack-contacts.php were designed to be independent, but all rely on the config.php and functions.php files. This allows you to pick and choose what you want and for different Slack commands instead of one universal /cw tickets 249123 and /cw contact john doe it can be /t 249123 and /c john doe.

Note: This project is currently being maintained for bugs only, all further new feature development is being done on the hosted successor at https://mspic.io

Note: As of July 2019, you need a Client ID to use any public integrations with the ConnectWise APIs. You'll need to sign up for a developer account at https://developer.connectwise.com and you can then generate a Client ID which goes into config.php as $cwClientId. This does not apply to hosted integrations such as mspIC, as that is handled by the host. Generate your ID here: https://developer.connectwise.com/ClientID

Usage

  • cwslack.php: Pull ticket information, create new tickets, change status, and change priority.
  • cwslack-activities.php: Pull activity information
  • cwslack-contacts.php: Pull contact information
  • cwslack-configs.php: Pull configuration record information
  • cwslack-tasks.php: View and update tasks on tickets
  • cwslack-notes.php: Post notes to tickets
  • cwslack-time.php: Post time entries to tickets and report on time sheets.
  • cwslack-incoming.php: Receive ticket creation/update notices in Slack
  • cwslack-follow.php: Follow a ticket to be direct messaged when updated
  • cwslack-firmalerts.php: Receive notifications when firm appointments are coming up
  • cwslack-dbmanage.php: Manage the MySQL user database within Slack.

Installation Instructions

This script set and all modules require PHP version 5 and the cURL extension, and many require a MySQL or MariaDB server.

For unsupported non-MySQL installation instructions, please see README_NoMySQL.md

See TROUBLESHOOT.md first if you have any issues. Otherwise, contact info below.

You can reach me on the r/msp Discord, LabTechGeek Slack, or via reddit at /u/jundis if you need basic support.

You can also reach me at joey(at)und.is should you need more intense support, custom modifications, or want your install done by me.

Update Instructions

Use the scripts found in the updates folder to upgrade from an older version to current. This will automatically update the config.php file with necessary values and create any new MySQL tables as well. You can also manually update by comparing the config file from this repository to your active one.

cwslack.php, activities, contacts, notes, configs, tasks, time, and dbmanage

  1. Download the respective php file, functions.php, install.php, and config-default.php files.
  2. Place on a compatible web server
  3. Rename config-default.php to config.php
  4. Create a new slack slash command integration at https://SLACK TEAM.slack.com/apps/A0F82E8CA-slash-commands
  5. Set command to reflect the task necessary. E.x. /t for tickets, /act for activities, /note for notes.
  6. Set the URL to https://domain.tld/cwslack.php (or other php file)
  7. Set Method to GET
  8. Copy the token
  9. Set a name, icon, and auto complete text if wanted.
  10. Run install.php and proceed through database setup. This will also verify you have the required PHP and cURL versions.
  11. Complete the install.php configuration, or manually modify the config.php file with the necessary values. Full configuration info found in config.php comments.
  12. Test it in Slack!

cwslack-incoming.php

  1. Download the cwslack-incoming.php, functions.php, install.php, and config-default.php files.
  2. Place on a compatible web server
  3. Rename config-default.php to config.php
  4. Create a new slack incoming web hook integration at https://my.slack.com/services/new/incoming-webhook/
  5. Set a name, icon, and if wanted.
  6. Set channel that you want to post to and copy the Web hook URL
  7. Create a new integrator login in ConnectWise:
  • Go to System > Setup Tables in the client
  • Type "int" in the table field and select Integrator Login
  • Create a new login with whatever username/password, we don't need this.
  • Set Access Level to "All Records"
  • Enable "Service Ticket API" and select the board(s) you want this to run on.
  • Enter https://domain.tld/cwslack-incoming.php?id= for the callback URL (do not enable legacy format)
  1. Modify the config.php file with your companies values and timezone, make sure to set the value for $webhookurl to the value copied in step 5.
  2. Change the $postupdated and $postadded to what you prefer. Enabling $postupdated can get spammy.
  3. Test it in Slack by creating a new ticket on the board you selected in step 6!

Different boards to different channels

As of version 2.4 the implementation has been changed from using callback URLs to using the $boardmapping variable in config.php

cwslack-firmalerts.php AND cwslack-priorityalerts.php

(Requires some variables from cwslack-incoming.php to function if you don't use that)

Priority alerts uses the same instructions, same cron line just different file name.

  1. Download the cwslack-firmalerts.php, functions.php, install.php, and config-default.php files.
  2. Place on a compatible web server.
  3. Rename config-default.php to config.php
  4. Run install.php and proceed through database setup. This will also verify you have the required PHP and cURL versions.
  5. Change $posttousers or $posttochan to 0 in config.php if you don't want it posting to one or the other.
  6. Setup a cron job or scheduled task on your server to run this PHP file every minute.
    Cron: * * * * * /usr/bin/php /var/www/cwslack-firmalerts.php >/dev/null 2>&1
  7. Set a firm appointment and test

cwslack-timealerts.php

(Requires some variables from cwslack-firmalerts.php and cwslack-time.php to function if you don't use those)

  1. Download the cwslack-timealerts.php, functions.php, install.php, and config-default.php files.
  2. Place on a compatible web server.
  3. Rename config-default.php to config.php
  4. Run install.php and proceed through database setup. This will also verify you have the required PHP and cURL versions.
  5. Change $posttousers or $posttochan to 0 in config.php if you don't want it posting to one or the other.
  6. Setup a cron job or scheduled task on your server to run this PHP file every 30 minutes.
    Cron: */30 * * * 1-5 /usr/bin/php /var/www/cwslack-timealerts.php >/dev/null 2>&1
  7. Fail to enter time and test! It will alert after 2 hours of time is lacking.

cwslack-lunch.php

This module requires a cron job or other scheduled task to clear the Lunch database table at midnight each night.

Schedule using the following line in crontab.

0 0 * * * /usr/bin/php /var/www/cwslack-lunch-cron.php >/dev/null 2>&1

cwslack-follow.php

(Also requires cwslack-incoming.php to function)

  1. Download the cwslack-follow.php, functions.php, install.php, and config-default.php files.
  2. Place on a compatible web server
  3. Rename config-default.php to config.php
  4. Create a new slack slash command integration at https://SLACK TEAM.slack.com/apps/A0F82E8CA-slash-commands
  5. Set command to /follow (or other if you prefer)
  6. Set the URL to https://domain.tld/cwslack-follow.php
  7. Set Method to GET
  8. Copy the token
  9. Set a name, icon, and auto complete text if wanted.
  10. Run install.php and proceed through database setup. This will also verify you have the required PHP and cURL versions.
  11. Modify the config.php file with your companies values and timezone. Full configuration info found in config.php comments.
  12. Test it in Slack!

To enable ConnectWise link to follow and unfollow a ticket:

  1. Open Setup Tables in ConnectWise.
  2. Open the "Links" table.
  3. Create a new Link referencing "Service"
  4. Set the Link Name to "Slack Follow"
  5. Set the Link Definition to https://yourdomain.tld/cwslack-follow.php?memberid=[memberid]&srnumber=[srnumber]&method=follow
  6. Create a new Link referencing "Service"
  7. Set the Link Name to "Slack Unfollow"
  8. Set the Link Definition to https://yourdomain.tld/cwslack-follow.php?memberid=[memberid]&srnumber=[srnumber]&method=unfollow
  9. Change the "method" on these links to whatever you set your $followtoken and $unfollowtoken to in config.php.
  10. Test the links!

API Key Setup

  1. Login to ConnectWise
  2. In the top right, click on your name
  3. Go to "My Account"
  4. Select the "API Keys" tab
  5. Click the Plus icon to create a new key
  6. Provide a description and click the Save icon.
  7. Save this information, you cannot retrieve the private key ever again so if lost you will need to create new ones.

Command Usage

* denotes required

cwslack.php

/t [ticket number or new]* [command] [option3]

status

option3 should be a valid status for your ticket. This can be partial: e.x. /t 592139 status need, can set the status to Need To Schedule if that is the only status with the word "need" in it.

priority

option3 should be a valid priority for your ticket. Accepts partial like status above.

full (or) notes (or) all

If $posttext=1 in config.php, shows you the latest note and the initial note. This displays to you only to avoid spam.

initial (or) note (or) first

If $posttext=1 in config.php, shows you the initial note of the ticket. This displays to you only to avoid spam.

new [board name]|[company name]|[ticket summary]

Use new instead of a ticket number to create a new ticket. Pipe symbols are required between [board name], [company name], and [ticket summary], but brackets are not used in final command.

Only include [board name] if you have $useboards set to 1 in config.php.

scheduleme [time]

Schedules you for the specified ticket at the specified time. Accepts most reasonable forms of time (e.x. 4:00PM, Tomorrow 4:00PM, 1/4/2017 4:00PM, Wednesday 4:00PM)

schedule [user] [time]

Schedules the specified user for the ticket at specified time. Accepts most reasonable forms of time like above.

cwslack-activities.php

/act new*|[activity title]*|[assigned to]*

All are required for activities. New will be replaced with more commands in the future.

cwslack-follow.php

/follow [ticket number]* (unfollow)

Add unfollow to the end of the command to stop following a ticket.

cwslack-contacts.php

/contact [last name]* OR [first name] [last name]

Either option works, but you cannot search by first name only.

cwslack-notes.php

/note [ticket number]* [internal OR external OR externalemail]* [ticket note]*

This does allow spaces for the ticket note so do not wrap in quotation marks or anything. Using "externalemail" as the option will trigger notifications according to boxes checked on ticket "Send Notes as Email"

cwslack-configs.php

/config [company name]*|[config name]*

Requires pipe symbol between the two, will return details on config that matches search.

cwslack-tasks.php

/tasks [ticket number]* [command]* [task number] [note]

Commands:

  • list : List all tasks on [ticket number]
  • open/reopen : Mark a task as open, removing the done flag, requires [task number].
  • close/complete/done/completed : Mark a task as done, requires [task number]. Can also add [note] for a resolution note.
  • update/change/note : Change the note on a task, requires [task number] and [note].
  • new/add : Add a new task to the end of the priority list, requires [note] but do not include [task number].

cwslack-time.php

/times [ticket number]* [type]* [time]* [note]*

  • [ticket number] = A valid ticket number
  • [type] = Eitehr detailed, internal, or resolution. Also accepts d/i/r instead
  • [time] = Shorthand time, use digits then h or m to designate units. E.x. 1.5h, 35m, 80m. NOT 1.5 hours, 35 minutes, etc
  • [note] = Any sentence to be used as the ticket note.

/times report [user]

  • Accepts a username (direct CW or Slack mapped) and outputs their daily time information
  • If no user name is specified, it uses your Slack username as the target

/times reportall

  • No input, just outputs a list of users who have entered time and their time information.

cwslack-dbmanage.php

/dbm [command]* [options]

Commands available:

  • help - Display this help text
  • listmap - List all username mappings between CW and Slack
  • addmap [slackname]* [cwname]* - Associate the two names
  • removemap [slackname]* - Remove a mapping
  • clearfollow confirm* - Clears the follow database

cwslack-slashcommands's People

Contributors

damiankw avatar jundis avatar shayughul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cwslack-slashcommands's Issues

Feature Request: Notify Followers on Ticket

Similar to what cwslack-follow is currently doing except instead of initiating the follow from Slack, I receive notifications if I "Follow" a ticket in CW. This I believe will require some way to map users in CW to users in Slack.

CW 2016.6 Change of URL

I just recently installed this and was trying to get it working and realized the URL for the CW side is different. We use Hosted CW.

From the looks of it it changed from /v4_6_release/ to /v2016_6/

Now I tried to update the code and I still get an error inline in Slack saying:
"Array not returned in line 195. Please check your connectwise URL variable in config.php and ensure it is accessible via the web at https://api-na.myconnectwise.net/v2016_6/apis/3.0/se....."

I did try the other way also and get same error.
"Array not returned in line 195. Please check your connectwise URL variable in config.php and ensure it is accessible via the web at https://api-na.myconnectwise.net/v4_6_release/apis/3.0/service/tic....."

Sorry if this is not a place for this, the only comment section I found.

Submit new internal and external facing ticket notes.

Internal suggestion.

Would be using /note command, adding more to /t just makes it too cluttered and combined which is unlike how the rest of the scripts were created.

/note 431823 internal This is an internal note!
/note 443723 external Hello, external note!

vs

/t 512377 note internal "This is an external note!"
/t 412384 note external "Hello, external note!"

Timezone error

in <b>/var/www/html/cwslack.php</b> on line <b>193</b><br /> <br /> <b>Warning</b>: date(): It is not safe to rely on the system's timezone settings. You are ​required​ to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Add alerting to specific channel for actual hours > 1

Internal suggestion.

Effectively:

  1. Connectwise User A submits new ticket.
  2. cwslack-incoming.php generates new ticket message to whatever channel is set in Slack web panel.
  3. User A then adds a time entry for 30 minutes, if updates are enabled then it would post to same channel.
  4. User B then adds a 1 hour time entry, bringing the total to 1.5 which is greater than 1. This sends a new message to the channel specified in $dispatchchan alerting that the total time on a ticket is greater than 1 hour.
  5. User A then adds a 15 minute time entry, and it posts again to channel $dispatchchan.

This would all be controlled by a variable such as $posttime and allow for variable time if you want it to alert at 1.0 hours or maybe 1.5 hours.

Create install script?

This is a concept issue. May not actually make it into the final 2.0 release, but depending on how useful I can make it we'll see.

Add BadStatus filtering

I don't need to get notifications for "> Closed" statuses and would like to filter them out, like BadBoard.

Integrate MySQL or other relational database

Goal would be to allow for the choice between flat file and MySQL/MariaDB/etc to allow for much better management. Future modules would rely 100% on database but existing modules would keep flat file compatibility.

Looking for feedback on this from users before diving into.

Pros:

  1. Easier management
  2. Better organization
  3. Better future proofing by avoiding a large swath of text files later down the road
  4. No issues with text file corruption or 1 line screwing up the entire thing
  5. Could move configuration to web interface.

Cons:

  1. Requires more server resources
  2. Longer setup process
  3. Requires back end management OR adding a multitude of admin commands to Slack or front end to configure.
  4. Possible database issues.
  5. Another layer of things to troubleshoot if things aren't working.

Project license

A lot of people ando companies won't touch code unless it's licensed, whether it be contributing or using, so it's something to consider.

Allow wildcard in config search

We use configurations in CW that pull data on endpoints from Kaseya. I have modified our cwslack-config.php to pull in the data, including model, warranty, etc. Is there anyway to do a wildcard search in configs? Or at least search all configurations based on the name? I am looking through the code now but I am not as versed in CW.

for example, instead of having to type out /config name of client here|server123FS.root.cnd, I'd like to be able to type /config server12* and still allow the config to be found.

Project license

A lot of people ando companies won't touch code unless it's licensed, whether it be contributing or using, so it's something to consider. The MIT license is the friendliest for a lot of companies and people.

Put the message body in the ticket notification

I can't be in front of CW all day, so I use the Slack integration mostly to avoid getting a million emails about ticket updates. The updates are a good start, but I'd love to see the message in the alert so I could see what the user has updated with to know if it's something I need to deal with now or can table till later.

Calling a contract results in error with markdown text, but pulls the contact

I've updated to 1.6 and the cw-contact seems to not be working on my system, but I'm sure it's just a misconfiguration on my end somewhere. When I perform "/cwcontacts Smith", I get the follow returned:

<br />
<b>Notice</b>:  Undefined property: stdClass::$communicationItems in <b>/var/www/html/cwslack-contacts.php</b> on line <b>100</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/var/www/html/cwslack-contacts.php</b> on line <b>104</b><br />
<br />
<b>Notice</b>:  Undefined property: stdClass::$name in <b>/var/www/html/cwslack-contacts.php</b> on line <b>115</b><br />
{
   "parse": "full",
   "response_type": "in_channel",
   "attachments": [
       {
           "fallback": "Contact Info for John Smith",
           "title": "Company: ",
           "pretext": "Contact Info for John Smith",
           "text": "",
           "mrkdwn_in": [
               "text",
               "pretext"
           ]
       }
   ]
}

Better error detection for line 195 issues

Users receive error starting at line 195 if their Connectwise URL is incorrect in config.php. Need better error catching so it is understandable what the problem is.

Add initial configuration to config.php

Initial MySQL config required for config.php, in case people do not use the install.php.

Probably can move this to a better spot, or require install.php or provide .sql files. Bad to have it run literally every call.

Check other info required in fallback and add it

I just noticed that the fallback is missing more detail (like who posted). It might be an idea to examine all of the outputs for -incoming and see what information can be added to the fallback, without making it look cluttered.

I'll probably get onto this myself over the next few days!

Parse error

I'm getting the following error:

Parse error: syntax error, unexpected 'APIKEYSHOWNHERE*' (T_STRING) in /var/www/html/CW/config.php on line 27

Is this an API configuration error, or a webserver issue ?

Appreciate any advice.

Remind users/specific channel of firm appointments

Need to setup a new script to run based on cron or scheduled tasks for Windows, that when called will check all firm appointments for the next hour, and check each to see if there is a reminder set on them. If so and the reminder threshold has been reached, send a reminder to Slack towards a specific channel or the user themselves.

/config replies with markup

All other integrations seem to be working fine, but when I try a config, I get the following. This is after adding
var_dump($answerTData);
to line 90 of cwslack-configs.php. Command given was: /config client|sales05

client name and my URL changed to protect the innocent.

string(2272) "HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
x-server-name: CWSERVER
Link: 
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 25 Sep 2016 20:10:08 GMT
Content-Length: 1979

[{"id":11757,"name":"sales05.root.client","type":{"id":18,"name":"Managed Workstation","_info":{"type_href":"https://cw.MYCOMPANY.com/v4_6_release/apis/3.0/company/configurations/types/18"}},"status":{"id":1,"name":"Active","_info":{"status_href":"https://cw.MYCOMPANY.com/v4_6_release/apis/3.0/company/configurations/statuses/1"}},"company":{"id":923,"identifier":"client","name":"client","_info":{"company_href":"https://cw.MYCOMPANY.com/v4_6_release/apis/3.0/company/companies/923"}},"contact":null,"site":{"id":1109,"name":"Main","_info":{"site_href":"https://cw.MYCOMPANY.com/v4_6_release/apis/3.0/company/companies/923/sites/1109"}},"locationId":null,"businessUnitId":null,"deviceIdentifier":"KHJGHGJKH","serialNumber":"LKJKJGK","modelNumber":"7518E1U","tagNumber":null,"purchaseDate":null,"installationDate":"2015-09-24T13:30:00Z","installedBy":null,"warrantyExpirationDate":null,"vendorNotes":"","notes":null,"macAddress":"CC-52-AF-41-ED-B8","lastLoginName":"Sales06","billFlag":true,"backupSuccesses":null,"backupIncomplete":null,"backupFailed":null,"backupRestores":null,"lastBackupDate":null,"backupServerName":null,"backupBillableSpaceGb":null,"backupProtectedDeviceList":null,"backupYear":null,"backupMonth":null,"ipAddress":"192.168.4.165","defaultGateway":"192.168.4.1","osType":"7","osInfo":"Professional x64 Edition Service Pack 1 Build 7601","cpuSpeed":"1581 MHz x 4","ram":"8016 MB","localHardDrives":"     Free           Total  \r\nC: 287386 MB   465437 MB  \r\nQ: 1026 MB   9999 MB  \r\n","parentConfigurationId":null,"vendor":null,"manufacturer":{"id":12,"name":"Lenovo","_info":{"manufacturer_href":"https://cw.MYCOMPANY.com/v4_6_release/apis/3.0/procurement/manufacturers/12"}},"questions":null,"activeFlag":true,"managementLink":"341741014418654","remoteLink":null,"sla":null,"mobileGuid":"2b45f62e-fc0e-4ee5-b2be-d6735ce29ac3","_info":{"lastUpdated":"2016-09-24T08:07:53Z","updatedBy":"Kaseya"},"customFields":null}]"
<?xml version="1.0"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>0</int></value></member><member><name>faultString</name><value><string>Warning:Invalid argument supplied for foreach() in E:\PHP\CWSlack\cwslack-configs.php on line 112</string></value></member></struct></value></fault></methodResponse>{
   "parse": "full",
   "response_type": "in_channel",
   "attachments": [
       {
           "fallback": "Configuration Info for client\\sales05.root.client",
           "title": "Configuration: sales05.root.client",
           "pretext": "Configuration for:  client",
           "text": "*_Notes_*:\nNone\n*_Vendor Notes_*:\nNone\n*_Questions_*:\n",
           "mrkdwn_in": [
               "text",
               "pretext"
           ]
       }
   ]
}

CW version is v2016.5 (42287)

NO FALLBACK DEFINED

Hi,

In the Slack notification, NO FALLBACK DEFINED is displayed. If I can figure out how to pull/push whatever to Github I will, but the fix is to add:

"fallback" => "Info on Ticket #" . $dataTData->id,

to the first line of each attachment in the array:

$return =array( "parse" => "full", "response_type" => "in_channel", "attachments"=>array(array( "fallback" => "Info on Ticket #" . $dataTData->id, //Return info string with ticket number. "title" => "<" . $ticketurl . $dataTData -> id . "&companyName=" . $companyname . "|#" . $dataTData->id . ">: " . $dataTData->summary, //Return clickable link to ticket with ticket summary. "pretext" => "Info on Ticket #" . $dataTData->id, //Return info string with ticket number. "text" => $dataTData->company->identifier . " / " . $contact . //Return "Company / Contact" string "\n" . $dateformat . " | " . $dataTData->status->name . //Return "Date Entered / Status" string "\n" . $dataTData->resources, //Return assigned resources "mrkdwn_in" => array( "text", "pretext" ) )) ); }

I guess you could add whatever you wanted, I only wanted the Ticket #

Expand feature set beyond Slack

This project seems relatively easily portable for use with other services that use a REST API, two services of particular interest, in my mind, are Office Planner and Trello. Half of the leg work is already done via facilitating HTTP requests to Connectwise and returning the JSON object.

Integrations such as these eliminate the need for tools like Kanbanize.com to bring Agile methodologies to the Connectwise PSA and would put forth a lot of value.

CW Contact - Does not return "Site phone" or treturns markup if no email is specified

If I have a contact in CW, with a phone number type of "Site Phone" (the default company phone # i assume?) it does not pull that into the info returned into Slack. If that contact happens to not have an email set in CW, I get markup returned (I am guessing because $text is blank?)

]
string(2121) "HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
x-server-name: CWSERVER
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 29 Sep 2016 20:37:01 GMT
Content-Length: 1836

[{"id":6758,"firstName":"Dick","lastName":"smithS","type":null,"company":{"id":81,"identifier":"CCCDP","name":"CompanyName","_info":{"company_href":"https://cw.url.here/v4_6_release/apis/3.0/company/companies/81"}},"site":{"id":83,"name":"Main","_info":{"site_href":"https://cw.url.here/v4_6_release/apis/3.0/company/companies/81/sites/83"}},"addressLine1":null,"addressLine2":null,"city":null,"state":null,"zip":null,"country":null,"relationship":{"id":0,"name":"","_info":{"relationship_href":"https://cw.url.here/v4_6_release/apis/3.0/company/contacts/relationships/0"}},"department":null,"inactiveFlag":false,"defaultMergeContactId":null,"securityIdentifier":null,"managerContactId":null,"assistantContactId":null,"title":null,"school":null,"nickName":null,"marriedFlag":false,"childrenFlag":false,"significantOther":null,"portalPassword":null,"portalSecurityLevel":null,"disablePortalLoginFlag":false,"unsubscribeFlag":null,"gender":null,"birthDay":null,"anniversary":null,"presence":null,"mobileGuid":"42a66a98-af5a-4017-82a5-cadeb6ad4f06","facebookUrl":null,"twitterUrl":null,"linkedInUrl":null,"communicationItems":null,"_info":{"lastUpdated":"2016-09-29T20:36:07Z","updatedBy":"MyName","communications_href":"https://cw.url.here/v4_6_release/apis/3.0/company/contacts/6758/communications","notes_href":"https://cw.url.here/v4_6_release/apis/3.0/company/contacts/6758/notes","tracks_href":"https://cw.url.here/v4_6_release/apis/3.0/company/contacts/6758/tracks","portalSecurity_href":"https://cw.url.here/v4_6_release/apis/3.0/company/contacts/6758/portalSecurity","image_href":"https://cw.url.here/v4_6_release/apis/3.0/company/contacts/6758/image?lastModified=2016-09-29T20:36:07Z"},"customFields":null}]"
<?xml version="1.0"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>0</int></value></member><member><name>faultString</name><value><string>Warning:Invalid argument supplied for foreach() in E:\dokuwiki\CWSlack\cwslack-contacts.php on line 104</string></value></member></struct></value></fault></methodResponse>{
   "parse": "full",
   "response_type": "in_channel",
   "attachments": [
       {
           "fallback": "Contact Info for Dick smithS",
           "title": "Company: CompanyName",
           "pretext": "Contact Info for Dick smithS",
           "text": "",
           "mrkdwn_in": [
               "text",
               "pretext"
           ]
       }
   ]
}

This is with var_dump($answerTData); added to line 91 of cwslack-contacts.php

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.