get salesforce Contact details using api with php - php

I want to get details as below:
1) SalesForce API details to fetch user information from extension number
2) SalesForce API details to fetch Contact information from dialed number
3) SalesForce API details to log calls into SalesForce
So can anybody tell me what is the prerequirement for call api?Like any account creation,username and password required?

for (1) & (2) they're simple query calls, using the soap or rest api's you'd run a query,
select id, name, {whatever} from user where phone = 'the phone #'
select id, name, {whatever} from contact where phone = 'the phone #'
for (3) you would create a new record, typically a Task, with the relevant fields populated include the whoId field which would be the contactId of the person called.
You may find using one of the general purpose schema/query tools like SoqlX or Workbench useful as a discovery aid.

Related

Can I send extra data to Cybersource Secure Acceptance for use after a successful payment?

I'm trying to integrate Cybersource Secure Acceptance into a mobile app I'm building. Only problem is, I need to a way to pass extra data to the php that Cybersource supplies without the users entering, i.e: first name, last name, email, card number (not to save of course) and just have users review their order in a webview. How can this be done?
The short answer is yes, custom data fields are supported by CyberSource APIs. I would suggest you look at the guides relevant to your implementation. Start at https://support.cybersource.com/ and https://developer.cybersource.com/ to find the guides.
As a sample, however, if you're using the Simple Order API you can use the below fields to send data to CyberSource that will be returned to you in the reply. NOTE that Personally Identifiable Information is prohibited in these fields.
merchantDefinedData_field1
merchantDefinedData_field2
merchantDefinedData_field3
merchantDefinedData_field4
For data such as name, email address, etc that you already have stored and don't want the user to re-enter, this data can be POST'ed to the APIs via hidden input fields. Naturally, the field names must correspond to the API's required field names.

Microsoft Dynamics Nav API Error: Customer Posting Group must have a value in Customer

I have some trouble with API method for posting order info into 'API for Dynamics 365 Business Central'.
So in official doc about order says for create order you must add 'Customer Info' to the request body. Before that you must create Customer(doc for customer).
But if i try to create order with info from Customer request, i have error:
Error: "Application_FieldValidationException","message":"Customer Posting Group must have a value in Customer"
So main question is: How to create(or get) and set Posting Group into Customer request?
Or if it wrong way, how to do this right?
You can call a codeunit that creates the customer by passing some parameters to this codeunit, but if you use a POST to the customer API you cannot call the setup in the body. The request body needs the JSON object.
You can't create customer ready for posting via API.
Creating a customer ready for posting (with all posting setup) is something that should do by an interanl user (administrative/financial department) and not by an API.
The API can create the basic customer card, but posting groups and so on could depend on different administrative parameters that you could not always know.

Android - Match contacts with phone numbers from DataBase

I have a few little questions concerning contacts from Android.
I have a MySQL databases with users and their phone numbers and I want to retrieve the contacts from the contact list of the user phone which are matching with phone numbers in the database (-> users using the app in other words, a bit like whatsapp is doing when you see the contacts which are using the app..)
I was wondering how I could achieve that in an easy and rapid way.. I was guessing I could do as follow:
asynctask class which is retrieving all the contact list with a cursor
get the phone number of the current item in the cursor
execute a sql query to see if contact exist .. with LIKE %phonenumber% (through php script)
if exist, add the contact name to a list view
But this means that every times the user wants to see the list, there are a lot of requests that need to be done.
Does anyone have an idea of a better way to do it? An easier way ?

How can I login as another user with Salesforce API?

I created an script to get some information users send via SMS then create a Contact in Salesforce using that information with the Salesforce API and works fine, but I hard-coded the user and password so every time a user creates a Contact from SMS i´ll be the creator. How can I access user´s credentials for creating the Contact? I want to do something like: select Id from User WHERE Phone = $_GET['mobile'] and then make createdById equal to user's id. Is that possible without having an array or file with user´s passwords?
Thanks in advance.
Answered on success community by David "wOOt!" Liu
You can edit the CreatedById field to anyone you want using Apex - no credentials needed!
Salesforce needs to turn on this permission for your org first - I believe it's called "Create Audit Fields". This lets you modify fields such as CreatedDate, CreatedById, etc etc. Many orgs use this so it's actually a fairly common request - I just wrote code recently that changed a record's creator as well.
Some more definitions on Audit Fields can be found here:
http://www.salesforce.com/us/developer/docs/api/Content/system_fields.htm

Receiving database query results on mobile devices

I have created a MySQL database that contains information about patients and their current state of treatment along with other relevant information. Preliminary i manged to create a website where you can query about patients(using either their name or room no) and it'll display the requested information.But now i need to find a way so that when someone writes a relevant query (like patient name or room no) in a SMS and sends it to a predefined number they'l receive the requested information about that patient on their mobile in an SMS.Kindly guide me how to deal with this?

Categories