export facebook contacts to .csv - csv

I want to export all my facbeook contacts into .CSV format or any other contacts format
I have tried to import facebook contacts to yahoo mail then export both in .CSV but it didn't work with the new yahoo

If all you need is their name, you can call
https://graph.facebook.com/[YOUR_USER_ID]/friends?access_token=[ACCESS_TOKEN]
with an application access token either from one of your current applications or the Facebook access token tool.
This will return the name and facebook ID of all your friends in JSON form that you can convert to .CSV by just looping through the data array.
If you need more than just their name and facebook id, you'll have to use FQL by calling:
https://graph.facebook.com/fql?q=SELECT first_name, last_name, profile_url FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1=me())&access_token=[ACCESS_TOKEN]
The full list of fields you can query in your SELECT can be found here.

There appears to be a facebook application that can do this for you. I'm uncertain if it actually works as I have not tested it.

Related

Select id from JSON

I'm currently designing an app to display some attributes of products I have in a pricelist which is stored in a Google Sheets spreadsheet and I want it to get that data and show it
I have a google script which extracts all the data from the spreadsheet and returns a JSON. It's published as a web app and stored in a non visible component "Web1"
What I don't know how to do is to work with that JSON and select a particular row based on an ID that I get from a barcode scanner
I want it to work like this:
Get a result from the barcode reader
Display the result from the barcode scan in a textbox "Código de barras"
Use that result to filter from a JSON which is extracted from the spreadsheet
Display the JSON attribute "name" in the textbox "Producto"
I currently have this:
The web component works asynchronously, which means, first send the Get request and after having received the response in the GotText event, then do the further processing.

Monthly or weekly report of PayPal Completed Payments automatically

We can download a CSV or XLS of PayPal Completed Payments by manually going to https://business.paypal.com/merchantdata/reportHome and doing "Activity download":
But how to get this CSV report, automatically (via email or with an API), each week or each month, without having to manually log in on the website?
Note:
I've already looked at PayFlow reports and download-reports but it seems quite complex, and there is no full example (only XML samples but it's unclear how to use them)
I don't want to use IPN for this (I do use it for another task, but it's not perfectly reliable for other reasons, etc.)
Example of desired output:
"Date","Time","TimeZone","Name","Type","Status","Currency","Gross","Fee","Net","From Email Address","To Email Address","Transaction ID","Shipping Address","Address Status","Item Title","Item ID","Shipping and Handling Amount","Insurance Amount","Sales Tax","Option 1 Name","Option 1 Value","Option 2 Name","Option 2 Value","Reference Txn ID","Invoice Number","Custom Number","Quantity","Receipt ID","Balance","Address Line 1","Address Line 2/District/Neighborhood","Town/City","State/Province/Region/County/Territory/Prefecture/Republic","Zip/Postal Code","Country","Contact Phone Number","Subject","Note","Country Code","Balance Impact"
"3/1/2018","04:52:07","CET","John Doe","Website Payment","Completed","EUR","100.00","0","100","johndoe#gmail.com","contact#example.com",...
"3/1/2018","16:29:30","CET","Mike Abcd","Website Payment","Completed","EUR","100.00","0","100","mikeabc#example.com","contact#example.com",...
You will have to do it through the XML api. Basically, you make a post request with the example XML in the link you gave but with your data. The response will be in XML and you take the returned reportId and then call the get report api and it will return in xml the report data.

Mass Upload Files To Specific Contacts Salesforce

I need to upload some 2000 documents to specific users in salesforce. I have a csv file that has the Salesforce-assigned ContactID, as well as a direct path to the files on my desktop. Each contact's specific file url has been included in the csv. How can I upload them all at one and, especially, to the correct contact?
You indicated in the comments / chat that you want it as "Files".
The "Files" object is bit more complex than Attachments, you'll need to do it in 2-3 steps. What you see as a File (you might see it referred to in documentation as Chatter Files or Salesforce Content) is actually several tables. There's
ContentDocument which can be kind of a file header (title, description, language, tags, linkage to many other areas in SF - because it can be standalone, it can be uploaded to certain SF Content Library, it can be linked to Accounts, Contacts, $_GOD knows what else)
ContentVersion which is well, actual payload. Only most recent version is displayed out of the box but if you really want you can go back in time
and more
The crap part is that you can't insert ContentDocument directly (there's no create() call in the list of operations) .
Theory
So you'll need:
Insert ContentVersion (v1 will automatically create for you parent ContentDocuments... it does sound bit ass-backwards but it works). After this is done you'll have a bunch of standalone documents loaded but not linked to any Contacts
Learn the Ids of their parent ContentDocuments
Insert ContentDocumentLink records that will connect Contacts and their PDFs
Practice
This is my C:\stacktest folder. It contains some SF cheat sheet PDFs.
Here's my file for part 1 of the load
Title PathOnClient VersionData
"Lightning Components CheatSheet" "C:\stacktest\SF_LightningComponents_cheatsheet_web.pdf" "C:\stacktest\SF_LightningComponents_cheatsheet_web.pdf"
"Process Automation CheatSheet" "C:\stacktest\SF_Process_Automation_cheatsheet_web.pdf" "C:\stacktest\SF_Process_Automation_cheatsheet_web.pdf"
"Admin CheatSheet" "C:\stacktest\SF_S1-Admin_cheatsheet_web.pdf" "C:\stacktest\SF_S1-Admin_cheatsheet_web.pdf"
"S1 CheatSheet" "C:\stacktest\SF_S1-Developer_cheatsheet_web.pdf" "C:\stacktest\SF_S1-Developer_cheatsheet_web.pdf"
Fire Data Loader, select Insert, select showing all Salesforce objects. Find ContentVersion. Load should be straightforward (if you're hitting memory issues set batch size to something low, even 1 record at a time if really needed).
You'll get back a "success file", it's useless. We don't need the Ids of generated content versions, we need their parents... Fire "Export" in Data Loader, pick all objects again, pick ContentDocument. Use query similar to this:
Select Id, Title, FileType, FileExtension
FROM ContentDocument
WHERE CreatedDate = TODAY AND CreatedBy.FirstName = 'Ethan'
You should see something like this:
"ID","TITLE","FILETYPE","FILEEXTENSION"
"0690g0000048G2MAAU","Lightning Components CheatSheet","PDF","pdf"
"0690g0000048G2NAAU","Process Automation CheatSheet","PDF","pdf"
"0690g0000048G2OAAU","Admin CheatSheet","PDF","pdf"
"0690g0000048G2PAAU","S1 CheatSheet","PDF","pdf"
Use Excel and magic of VLOOKUP or other things like that to link them back by title to Contacts. You wrote you already have a file with Contact Ids and titles so there's hope... Create a file like that:
ContentDocumentId LinkedEntityId ShareType Visibility
0690g0000048G2MAAU 0037000000TWREI V InternalUsers
0690g0000048G2NAAU 0030g000027rQ3z V InternalUsers
0690g0000048G2OAAU 0030g000027rQ3a V InternalUsers
0690g0000048G2PAAU 0030g000027rPz4 V InternalUsers
1st column is the file Id, then contact Id, then some black magic you can read about & change if needed in ContentDocumentLink docs.
Load it as insert to (again, show all objects) ContentDocumentLink.
Woohoo! Beer time.
Your CSV should contain following fields :
- ParentID = Id of object you want to link the attachment to (the ID of the contact)
- Name = name of the file
- ContentType = extension(.xls or .pdf or ...)
- OwnerId = if empty I believe it takes your user as owner
- body = the location on your machine of the file (for instance: C:\SFDC\Files\test.pdf
Use this csv to insert the records (via data loader) into the Attachment object.
You will then see for each contact, that records have been added to the 'Notes & Attachments' related list.

Marketo API Custom Data

I am using the Marketo API V1 to get lead data from a customers Marketo account. I have successfully connected to the API (by going through their documentation).
I can get data for a single lead however it only displays the default data (id, firstName, lastName, email) and I know there are a lot of custom data fields (company, salutation, jobTitle etc.) but this does not show from the API - do you know how I can access this custom data?
Below is the API URL I am using which works fine just not showing all the data I require:
https://<<url>>/rest/v1/leads.json?access_token=<<token>>&filterType=email&filterValues=oliver#test.com
This returns:
{"requestId":"1261b#14f40fc3156","result":[{"id":2755951,"updatedAt":"2015-08-18T10:58:42Z","lastName":"wells","email":"oliver#test.com","createdAt":"2015-06-02T09:36:48Z","firstName":"oliver"}],"success":true}
Thank you very much!
You need to include a parameter, 'fields', which has a comma-separated list of field names to retrieve a given set of fields: http://developers.marketo.com/documentation/rest/get-multiple-leads-by-filter-type/ See example 2, there.

Moodle bulk user CSV import

I'm trying to use a CSV a to bulk import users
username, firstname, lastname, email, idnumber, auth, country, city, institution, course1
a#b.ac.uk, a, z, a#b.ac.uk, a, LDAP, GB, London, B, B-A-STA
The the auth entry drops out saying,
LDAP
Auth plugin not supported here
but the other entries seem fine and the user gets added. I can't seem to find documentation on adding auth types, how do I specify LDAP?
Here I use CAS auth and always get a similar message, but users get added normally. I don't know if it is a bug...