I am using Click Funnels and I wanted to add every new contact directly to the database without any integrations like Zapier or something else.
The problem I have is that while using the ClickFunnels API, I only have access to ten results of the first page.
https://api.clickfunnels.com/contacts.json?email={{email}}&auth_token={{auth_token}}
{
"data": [
...json objects...
],
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https://api.clickfunnels.com/contacts.json?auth_token={{auth_token}}&email={{email}}&page%5Bnumber%5D=1&page%5Bsize%5D=10",
"first": "https://api.clickfunnels.com/contacts.json?auth_token={{auth_token}}&email={{email}}&page%5Bnumber%5D=1&page%5Bsize%5D=10",
"prev": null,
"next": "https://api.clickfunnels.com/contacts.json?auth_token={{auth_token}}&email={{email}}&page%5Bnumber%5D=2&page%5Bsize%5D=10",
"last": "https://api.clickfunnels.com/contacts.json?auth_token={{auth_token}}&email={{email}}&page%5Bnumber%5D=4&page%5Bsize%5D=10"
}
}
I tried to change the page size value, but it doesn't work.
I want to view all the contacts.
What do you suggest I do?
Related
Making a script to create uniform gmail signatures and I noticed only a few users, out of the hundreds, have both user.organizations[0] and user.organizations[1]. This of course is bothering me terribly. I see on these users that the 1 is the primary and visible in GAC while the rest of the users that is the 0 that is visible. Is there a way to delete the extra organizations inside a user?
Yes, this is possible and it is very simple.
We will need to use 2 methods:
Users.get (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get) to check every user to confirm they have the correct value in the organizations property.
Users.update (https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/update) to replace the existing value on that property.
Steps:
Feel free to use the API Explorer available in the documentation above to test these API calls.
Use the Users.get method to obtain the data of the user you are interested in updating. You can make the result shorter by specifying a value in the fields parameter like so:
"fields": "primaryEmail,organizations"
This will return the data of the user including their primary email and a list of the organization(s) the user has.
{
"primaryEmail": "user#domain.com",
"organizations": [
{
"title": "Accountant",
"primary": true,
"customType": "",
"department": "Accounting",
"description": "Full Time accountant",
"costCenter": "CompanyTotalPro"
},
{
"title": "Accountant",
"primary": false,
"customType": "",
"department": "Accounting",
"description": "Part Time accountant",
"costCenter": "SecondaryCompany"
}
]
}
This response will contain the data of one or more organizations, you will only need to copy the value you want to maintain and make an API call using the Users.update method. Like so:
Don't worry about the code. What you need to see is that we are essentially obtaining the list of organizations and removing the one we don't want, and using the new set of information to overwrite the old one. Use this for reference.
gapi.client.directory.users.update({
"userKey": "user#domain.com",
"resource": {
"organizations": [
{
"title": "Accountant",
"primary": true,
"customType": "",
"department": "Accounting",
"description": "Full Time accountant",
"costCenter": "CompanyTotalPro"
}
]
}
})
Use null to clear the value.
"organizations": null
I'm looking to send out a Post json request using Zapier's webhook function, together with Slack's incoming webhook set up.
I'm using block kit to develop the message style, and so far that's worked great. However, I'd like my bot to display with a custom username and emoji/icon and I'm having trouble.
Here is the JSON payload I'm trying, based off this tutorial https://api.slack.com/methods/chat.postMessage#args
The post seems to ignore the first two lines and posts as the standard bot name
{
"as_user": false,
"username": "test",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*78 Varet St #14*\n 2 Bed / $2300 \n <#ben> \n 3rd Deposit This Month"
},
"accessory": {
"type": "image",
"image_url": "https://p.sharinpix.com/3/3521a32/YXBwLnNoYXJpbnBpeC5jb20vaW1hZ2VzL2I2M2RkZTY4LWZkMDMtNGZlYy04OGUxLWYwZjA0N2E4NjQ3NS90aHVtYm5haWxzL29yaWdpbmFsLWI5MTdlNzAzY2U2LmpwZw/77-varet-st-building.jpg?timestamp=1639154285",
"alt_text": "cute cat"
}
},
{
"type": "divider"
}
]
}
Any help would be greatly appreciated!
If you just want to modify the icon and name of your bot ( will be the same throughout the app ), you should be able to do that on https://api.slack.com/apps/{YOUR_APP_ID}/general? under the Display Information section.
If you want to be able to change it from message to message, you will have to grant your app additional permissions scopes. See https://api.slack.com/methods/chat.postMessage#authorship
I use the sharedpost endpoint to retrieve the pages that shared my post like this:
{post_id}/sharedposts?fields=likes.summary(1),id,created_time,from.summary(1)&limit=1500
This will return the data like:
{
"id": "{sharedpost_id}",
"created_time": "2017-05-13T23:01:51+0000",
"from": {
"name": "Page that shared",
"id": "Id of page that shared"
},
"likes": {
"data": [
],
"summary": {
"total_count": 0,
"can_like": false,
"has_liked": false
}
}
}
Now some posts get a shitload of shares so I want to filter only the shares by pages that have above a certain amount of likes.
Now I can make a second call to the api which asks for the amount of likes but I hope it would be possible to do this in the same request.
So The desired output would be:
{
"id": "{sharedpost_id}",
"created_time": "2017-05-13T23:01:51+0000",
"from": {
"name": "Page that shared",
"id": "Id of page that shared"
"likes: : "Likes of the page that shared"
},
"likes": {
"data": [
],
"summary": {
"total_count": 0,
"can_like": false,
"has_liked": false
}
}
}
So with the likes of the page included in the from.
Is this possible?
Thanks in advance!
Can be done using Field Expansion:
/post-id/sharedposts?fields=from{name,fan_count}
And if you need this not only for single posts, but for all posts in a page’s feed, you can also move that “one level up”, like so:
/page-id/feed?fields=sharedposts{from{name,fan_count}}
I am not exactly sure if that still works, if you also get shared posts by users returned - in that case it might throw an error, that fan_count is not an existing field on the user object.
This would only be relevant for posts shared by users that have logged in to your app, and granted it user_posts permission (because only then would you see those posts show in the sharedposts edge in the first place) - so if that is not applicable in your situation, it will be fine; otherwise I suggest you test this case before relying on it.
I'm battling with the WikiEditor extension of MediaWiki 1.27. When a user tries to use the fancy image upload button from the enhanced editor toolbar, I get the message "You must be logged in to upload files."
So far I've narrowed it down to the user rights returned from the API being incomplete. I've tested with the following two API calls:
The one WikiEditor uses: action=query&meta=userinfo&uiprop=rights
returns:
{
"batchcomplete": "",
"query": {
"userinfo": {
"id": 1006,
"name": "john_smith",
"rights": [
"read",
"createpage",
"createtalk",
"writeapi",
"editmyusercss",
"editmyuserjs",
"viewmywatchlist",
"editmywatchlist",
"viewmyprivateinfo",
"editmyprivateinfo",
"editmyoptions",
"autocreateaccount"
]
}
}
}
However, this API call: action=query&list=users&ususers=john_smith&usprop=rights returns:
{
"batchcomplete": "",
"query": {
"users": [
{
"userid": 1006,
"name": "john_smith",
"rights": [
"block",
"createaccount",
"delete",
"bigdelete",
"deletedhistory",
"deletedtext",
"undelete",
"editinterface",
"editusercss",
"edituserjs",
"editcontentmodel",
"import",
"importupload",
"move",
"move-subpages",
"move-rootuserpages",
"move-categorypages",
"patrol",
"autopatrol",
"protect",
"editprotected",
"rollback",
"upload",
"reupload",
"reupload-shared",
"unwatchedpages",
"autoconfirmed",
"editsemiprotected",
"ipblock-exempt",
"blockemail",
"markbotedits",
"apihighlimits",
"browsearchive",
"noratelimit",
"movefile",
"unblockself",
"suppressredirect",
"mergehistory",
"managechangetags",
"deleterevision",
"read",
"createpage",
"createtalk",
"writeapi",
"editmyusercss",
"editmyuserjs",
"viewmywatchlist",
"editmywatchlist",
"viewmyprivateinfo",
"editmyprivateinfo",
"editmyoptions",
"autocreateaccount",
"edit",
"minoredit",
"purge",
"sendemail",
"applychangetags",
"changetags"
]
}
]
}
}
I'm totally stumped and at a loss of why these two very similar API calls return a different set of rights. As a result, users are not able to upload images via the enhanced editor button.
I am using the Sharefile REST API for a project and have run into an issue. Their documentation is lacking and so far my 5 emails to the api# address have gone unanswered. Figured I would crowdsource this one...
What I need to do is search for a file by its name and it also has to have a specific parentID. I am following their documentation as best I can, but I still get a 500 error on the response.
According to their API documentation I have to post to: https://account.sf-api.com/sf/v3/Items/AdvancedSimpleSearch with the following post:
{
"Query":{
"AuthID":"",
"ItemType":"",
"ParentID":"",
"CreatorID":"",
"LuceneQuery":"",
"SearchQuery":"",
"CreateStartDate":"",
"CreateEndDate":"",
"ItemNameOnly":"",
},
"Paging":{
"Key":"",
"PageNumber":1,
"PageSize":10,
},
"Sort":{
"SortBy":"",
"Ascending":false,
},
"TimeoutInSeconds":10
}
The JSON post I am sending looks like this:
{
"Query": {
"AuthID": "",
"ItemType": "",
"ParentID": "xxxxxxxxxxxx",
"CreatorID": "",
"LuceneQuery": "",
"SearchQuery": "filename ='foo.png'",
"CreateStartDate": "4/2/2014",
"CreateEndDate": "4/4/2014",
"ItemNameOnly": ""
},
"Paging": {
"Key": "",
"PageNumber": 1,
"PageSize": 10
},
"Sort": {
"SortBy": "",
"Ascending": false
},
"TimeoutInSeconds": 10
}
They prefilled some properties in their example post so I replicated. I did also try sending only what I needed too (instead of the blank properties) but still get a 500.
I can upload files, delete, modify, etc all fine with no issues so I am certain it is something in this JSON structure. I think it comes down to the "SearchQuery" property. There is zero examples on their documentation site, and any libraries that were made 3rd party only show a "query" parameter being passed in with no example of what that looks like...
Try This:
{
"Query": {
"AuthID": "",
"ItemType": "",
"ParentID": "xxxxxxxxxxxx",
"CreatorID": "",
"LuceneQuery": "",
"SearchQuery": "foo.png",
"CreateStartDate": "4/2/2014",
"CreateEndDate": "4/4/2014",
"ItemNameOnly": ""
},
"Paging": {
"Key": "",
"PageNumber": 1,
"PageSize": 10
},
"Sort": {
"SortBy": "",
"Ascending": false
},
"TimeoutInSeconds": 10
}
In searchQuery we have to specify item name itself instead of filename='itemname'. Working for me :)
I've been trying to wrestle with this too. I am using the HTTPS API and not the REST API, but maybe the same argument will work? My client has specified PHP so looking at Sharefile's PHP sample code sharefile.php - you will see a search function with a "$query" parameter. After a few attempts I tried supplying this argument: '{Name="Agreements"}'. I think you might be able to generalize to more complicated searches. The PHP sample code does a http_build_query to convert the above to the usual HTML parameter string.