Get Smooch Whatsapp user number - smooch

I'm testing Smooch Javascript SDK (https://docs.smooch.io/rest/#introduction) integrated to Whatsapp. I want to know if its possible to get user's phone number when I recieve a webhook request, the phone number is not in the request body.
// This is the request body I get
{
"trigger": "message:appUser",
"app": { "_id": "5d308957198c1f00104a3b88" },
"version": "v1.1",
"messages": [
{
"type": "text",
"text": "Hello",
"role": "appUser",
"received": 1563472958.747,
"name": "Kevin Arias",
"authorId": "2d4628bcb45b234a1ff",
"_id": "5d30b43ee223faa28f",
"source": {
"type": "whatsapp",
"integrationId": "5d308964a75fd5a457f",
"originalMessageId": "ABEGVzElE6JZEN_vQ92XFBiIrb4S",
"originalMessageTimestamp": 1563472958
}
}
],
"appUser": {
"_id": "2d4628b5cb45b234a1ff",
"conversationStarted": true,
"surname": "Arias",
"givenName": "Kevin",
"signedUpAt": "2019-07-18T15:00:45.883Z",
"properties": {}
},
"conversation": { "_id": "84860727bddac962a8b" }
}
Thanks,

If you enable the includeClient option on your Smooch webhook, there will be a client object included in the webhook payload, representing the source of the message. The WhatsApp username (typically the user's phone number) will be available under client.externalId

Related

Integrating Docusign Identity Verification (Phone Authentication) with an envelope

I was using identity verification feature from Docusign with envelopes. Previously, envelopes are working fine without it. Then I enabled this feature and searched on the Docusign API Documentation, how to implement this feature. I got the necessary details like authentication token, workflow id. Try to hit the endpoint using Post request. Everything's fine but having issues in the body part of the post request getting invalid phone number response. Thank you for your time! Please help!
//Post request endpoint
https://demo.docusign.net/restapi/v2.1/accounts/f8594d59-9d52-xxxx-xxxx-xxxxxxxxxxxx/envelopes
//header
Authorization: Bearer {accestoken}
Content-Type: application/json
Acces: application/json
//request body
{
"accountId": "f8594d59-9d52-xxxx-xxxx-xxxxxxxxxxxx",
"templateId": "4e2ba389-5d26-xxxx-xxxx-xxxxxxxxxxxx",
"emailSubject": "Please sign the contract",
"templateRoles": [
{
"roleName": "Sender",
"name": "Name",
"email": "fName.lName#xyz.com",
"identityVerification": {
"workflowId": "c368e411-1592-xxxx-xxxx-xxxxxxxxxxxx",
"steps": null,
"inputOptions": [
{
"name": "phone_number_list",
"valueType": "PhoneNumberList",
"phoneNumberList": [
{
"countryCode": "1",
"number": "8956324511"
}
]
}
]
}
},
{
"roleName": "Customer",
"name": "cFName",
"email": "cFName.cLName#gmail.com"
}
],
"status": "sent"
}
//Response
{
"errorCode": "PHONE_NUMBER_INVALID",
"message": "Phone number is not valid."
}
//Expected Response can vary
{
"envelopeId": "e8342cd0-ea2b-xxxx-xxxx-xxxxxxxxxx",
"uri": "/envelopes/e8342cd0-ea2b-xxxx-xxxx-xxxxxxxxxx",
"statusDateTime": "2023-01-13T05:22:35.0100000Z",
"status": "sent"
}
According to https://www.areacodehelp.com/where/area_code_895.shtml area code 895 is not valid.
Try with a valid phone number to confirm the issue, but to me it looks like the number you used here is indeed not a valid phone number.
PS
If you meant to use a number in Azerbaijan, you need to change the country code from "1" to "895" as it's a country code for a different country (the way you have is if for the USA)
So, basically what I found is ID verification won't work with template roles because of the syntax compatibility. But it will work with composite templates, I made it work with composite template.
Additionally, both of the methods are compatible idVerification or phoneAuthentication. I am using idVerification for the first Signer and phone Authentication for the second signer
Docusign docs have more methods as well like sms auth, etc. Explore it from these links:
https://developers.docusign.com/docs/esign-rest-api/how-to/phone-auth/
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/
Check examples, in my usecase I explored Generic JSON Request/Response
Thanks for all the support from Inbar and the community!
{
"accountId": "f8594d59-9d52-xxxx-xxxx-xxxxxxxxxx",
"emailSubject": "Please sign the contract",
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "4e2ba389-5d26-xxxx-xxxx-xxxxxxxxxx"
}
],
"inlineTemplates": [
{
"sequence": "2",
"recipients": {
"signers": [
{
"roleName": "Sender",
"recipientId": "1",
"name": "Name",
"email": "fName.lName#xyz.com",
"identityVerification": {
"workflowId": "c368e411-1592-xxxx-xxxx-xxxxxxxxxx",
"steps": null,
"inputOptions": [
{
"name": "phone_number_list",
"valueType": "PhoneNumberList",
"phoneNumberList": [
{
"countryCode": "1",
"number": "1234567890"
}
]
}
]
}
},
{
"roleName": "Customer",
"recipientId": "2",
"name": "cName",
"email": "cfName.clName#gmail.com",
"phoneAuthentication": {
"senderProvidedNumbers": [
"+11234567890"
],
"recipMayProvideNumber": false
},
"idCheckConfigurationName": "Phone Auth $"
}
]
}
}
]
}
]
}
Note: Use valid phone number!

re-invite outcast user from room

Is there a way via the API to re-invite a user to a room who has previously been outcast?
Created a room
POST /create_room_with_opts
{
"name": "testroompersistent",
"service": "foo",
"host": "bar" ,
"options": {
"title": "Super important meeting",
"description": "This meeting is super important",
"persistent": "true",
"allow_user_invites": "true"
}
}
Invited a user
POST /send_direct_invitation
{
"name": "testroompersistent",
"service": "foo",
"password": "",
"reason": "Check this out!",
"users": "user#companyDomain.co.uk"
}
User joins room
Admin sets user affiliation to "outcast"
POST /set_room_affiliation
{
"name": "testroompersistent",
"service": "foo",
"jid": "userJid",
"affiliation": "outcast"
}
Invited a user again
POST /send_direct_invitation
{
"name": "testroompersistent",
"service": "foo",
"password": "",
"reason": "Check this out!",
"users": "user#companyDomain.co.uk"
}
Set affiliation to "member"
POST /set_room_affiliation
{
"name": "testroompersistent",
"service": "foo",
"jid": "userJid",
"affiliation": "member"
}
I've tried to set the affiliation before and after the invite but to no avail.
I was using the jid I got back from /get_room_occupants to set the affiliation this jid had "/[numbers]" after it and I assume it wasn't setting the affiliation correctly. I was getting 0=success back but it must not have been working correctly.
I have changed the jid to exclude the random numbers I got back from /get_room_occupants. Thanks #badlop for taking the time to respond.

How can I see logs of the JSON post bodies sent by zapier to my CRM (Current RMS) via the Webhook zap during setup and testing?

I'm trying to send new users / new customres of my WooCommerce store into the rental management app current-rms.com as new Organisations / new contacts. Since Current RMS does not have a native Zap, I am trying to use the generic Webhook zap that Zapier maintains.
Specifically, I'd like to see the sent JSON body in Zapier posts that I make during the setup and testing of the Zap after clicking "Make a Zap!". The Task History is not detailed enough nor does it show hits during test and setup, since it's not live yet.
My trigger is a WooCommerce New Customer. This is working with Zapier WooCommerce Plugin and webhooks OK.
My action is the generic Zapier "Webhooks" Zap. The label "instant" appears next to it in the list at /app/zaps and it is "off".
One version uses JSON PAYLOAD as the action.
Another version uses CUSTOM PAYLOAD as the action.
Wrap request in array is YES.
Unflatten is YES.
My API key and subdomain are in the app URL as query strings and working OK.
When I hit test I get:
We had trouble sending your test through.
The app returned "Invalid JSON - missing or invalid entry for 'member'". This usually happens when your Zap is missing a required field or a field value isn't in a recognized format.
We made a request to api.current-rms.com and received (400) Bad Request.
Official docs are at: https://api.current-rms.com/doc#members-members-post
Logging available at Current RMS side
Part of the authentication of Current RMS involves knowing the domain of the account you are trying to access, in my case its therockfactory due to it being an account for my company https://therockfactory.net/
https://api.current-rms.com/api/v1/members?apikey=APIKEYCENSORED&subdomain=therockfactory
which returns the following when I use the correct API key:
{"webhook_logs":[],"meta":{"total_row_count":0,"row_count":0,"page":1,"per_page":20}}
Maybe if I could see the actual hit that Zapier is posting to Current I could wrap my confused brain around it better? What me worry.
The hit should look somewhat similar to this example, but I've not been able to locate it so far... (in Zapier)
Headers
Content-Type: application/json
Body
{
"member": {
"name": "Chris Bralton",
"description": "Pictures and leaned back was strewn at one would rather more. People don't want of his own means of one hand! Unless it from our pioneer has he fallen tree but that ever stronger and a. Hid among us against the full of verdure through by my eyes.",
"active": true,
"bookable": false,
"location_type": 0,
"locale": "en-GB",
"membership_type": "Contact",
"lawful_basis_type_id": 10001,
"sale_tax_class_id": 1,
"purchase_tax_class_id": 1,
"tag_list": [
"[\"Red\", \"Blue\", \"Green\"]"
],
"custom_fields": {},
"membership": {},
"primary_address": {
"name": "Chris Branson",
"street": "16 The Triangle",
"postcode": "NG2 1AE",
"city": "Nottingham",
"county": "Nottinghamshire",
"country_id": "1",
"country_name": "United Kingdom",
"type_id": 3001,
"address_type_name": "Primary",
"created_at": "2015-06-29T10:00:00.000Z",
"updated_at": "2015-06-29T10:30:00.000Z"
},
"emails": [
{
"address": "abigail.parker#ggmail.co.uk",
"type_id": 4001,
"email_type_name": "Work",
"id": 1
}
],
"phones": [
{
"number": "+44 115 9793399",
"type_id": 6001,
"phone_type_name": "Work",
"id": 1
}
],
"links": [
{
"address": "www.facebook.com/profile.php?id=566828251",
"type_id": 5002,
"link_type_name": "Facebook",
"id": 1
}
],
"addresses": [
{
"name": "Chris Branson",
"street": "16 The Triangle",
"postcode": "NG2 1AE",
"city": "Nottingham",
"county": "Nottinghamshire",
"country_id": "1",
"country_name": "United Kingdom",
"type_id": 3002,
"address_type_name": "Billing",
"created_at": "2017-06-29T10:00:00.000Z",
"updated_at": "2017-06-29T10:30:00.000Z",
"id": 1
}
],
"service_stock_levels": [
{
"item_id": 10,
"store_id": 1,
"member_id": 1,
"asset_number": "Chris Bralton",
"serial_number": "",
"location": "",
"stock_type": 3,
"stock_category": 60,
"quantity_held": "1.0",
"quantity_allocated": "0.0",
"quantity_unavailable": "0.0",
"quantity_on_order": "0.0",
"starts_at": "",
"ends_at": "",
"icon": {
"iconable_id": 85,
"id": 1,
"image_file_name": "abigail.jpeg",
"url": "https://s3.amazonaws.com/current-rms-development/64a0ccd0-5fbd-012f-2201-60f847290680/icons/46/original/abigail.jpeg",
"thumb_url": "https://s3.amazonaws.com/current-rms-development/64a0ccd0-5fbd-012f-2201-60f847290680/icons/46/thumb/abigail.jpeg",
"created_at": "2015-06-29T10:00:00.000Z",
"updated_at": "2015-06-29T10:30:00.000Z",
"iconable_type": "StockLevel"
},
"custom_fields": {},
"id": 487,
"item_name": "Sound Engineer",
"store_name": "Nottingham",
"stock_type_name": "Service",
"stock_category_name": "Resource"
}
],
"day_cost": "",
"hour_cost": "",
"distance_cost": "",
"flat_rate_cost": "",
"icon": {
"image": ""
},
"child_members": [
{
"relatable_id": 317,
"relatable_type": "Member",
"related_id": 25,
"related_type": "Member"
}
],
"parent_members": [
{
"relatable_id": 317,
"relatable_type": "Member",
"related_id": 25,
"related_type": "Member"
}
]
}
}
UPDATE: After reading my chosen answer I was able to see what Zapier was sending:
[
{
"member[emails_attributes][0][address]": "test#test.co.nz",
"member[membership_type]": "Organisation",
"member[name]": "Testafari Testing"
}
]
You can send your webhook to a tool like this one to inspect the payloads that are being sent from anywhere on the internet: https://requestbin.com/
You can find more help in regards to using Webhooks by Zapier and other ideas on how you can troubleshoot issues stemming from its use: https://zapier.com/apps/webhook/help#inspect-the-requests

Root Site Facet not returned on sites/search call

When making a call to the Microsoft Graph /sites?search endpoint, a root site facet is not returned.
Here is an example of the search:
https://graph.microsoft.com/v1.0/sites?search=fake Archive
It returns:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [{
"createdDateTime": "2017-11-04T18:52:44Z",
"id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
"lastModifiedDateTime": "2017-11-14T23:21:51Z",
"name": "fake Archive",
"webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
"displayName": "fake fake Archive"
}]
}
There is no root site facet. If I use the /site endpoint to access the site directly:
https://graph.microsoft.com/v1.0/sites/fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8
I get the response:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
"createdDateTime": "2017-11-14T23:19:51.437Z",
"description": "",
"id": "fakeau.sharepoint.com,0f736b6a-d7fa-498d-b13f-72af82d58b49,7c055ac7-0d31-4341-8158-8055950f37c8",
"lastModifiedDateTime": "2018-03-23T12:23:40Z",
"name": "fake Archive",
"webUrl": "https://fakeau.sharepoint.com/sites/fake Archive",
"root": {},
"siteCollection": {
"hostname": "fakeau.sharepoint.com"
},
"displayName": "fake fake Archive"
}
Notice this now has a root site facet.
Is this a bug, or are there some situations in which the root site facet should not be shown in the /sites?search results?
The sites/search endpoint only returns a small subset of a site's properties:
id, name, description, createdDateTime,lastModifiedDateTime, and webUrl.
In order to retrieve the full metadata, you'll need to make subsequent requests to the /sites/{id} endpoint.

Parsing the response from command prompt in jira plugin development

Hello I have written json and xml for Atlassian JIRA cloud plugin development, My plugin is for receiving the events(issue created,updated etc) which occurs in JIRA cloud and i'm successful in that, it is printing the response in cmd(success message:200 ok)
My question is how to parse that response and how to trigger the mail to all the users in the project
atlassian-connect.json
{
"name": "JIRA notification test",
"description": "Atlassian Connect add-on",
"key": "plug-in1",
"baseUrl": "https://2a410c6a.ngrok.io",
"vendor": {
"name": "Stark",
"url": "https://developer.atlassian.com"
},
"authentication": {
"type": "none"
},
"apiVersion": 1,
"modules": {
"webhooks": [
{
"event": "jira:issue_created",
"url": "/issue-created"
},
{
"event": "jira:issue_updated",
"url": "/issue-updated"
}
]
},
"scopes": [
"read"
]
}
atlassian-plugin.xml
<?xml version="1.0" ?>
<atlassian-plugin key="plug-in1" name="PlugIn" plugins-version="2">
<plugin-info>
<description>Atlassian Connect add-on</description>
<version>1</version>
<vendor name="My Organization, Inc" url="https://developer.atlassian.com" />
</plugin-info>
<remote-plugin-container key="container" display-url="http://localhost:8000">
</remote-plugin-container>
</atlassian-plugin>