Xero API LeaveTypeID - php

I'm trying to integrate a web app in PHP to integrate Xero. My objective is to submit a leave form to Xero from the application.
I'm using https://github.com/XeroAPI/XeroOAuth-PHP and did manage to get the employee lists. But the example request shows I need to pass the LeaveTypeID along with the EmployeeID. Where can I get the LeaveTypeIDs ie. What is the Leave type ID for Annual Leave or Sick leave. Here is the Sample xml Request I found in the example in http://developer.xero.com/documentation/payroll-api/leaveapplications/
<LeaveApplications>
<LeaveApplication>
<EmployeeID>5abad362-28aa-4c2c-a9cb-0899f7262d62</EmployeeID>
<LeaveTypeID>dc182d9a-a270-4f4e-acd7-af702d5a4382</LeaveTypeID>
<Title>My Test Leave</Title>
<StartDate>2013-04-11</StartDate>
<EndDate>2013-04-11</EndDate>
</LeaveApplication>
</LeaveApplications>
I searched the Internet, Xero documentation and the community portal but nothing is there> Any help is much appreciated.
Updates:
#ronanq - I've Tried that, using the following code to get the LeaveTypes from the Demo account
$response = $XeroOAuth->request('GET', $XeroOAuth->url('PayItems', 'payroll'));
pr($response); exit;
getting the following response:
code => 401
response => You do not have permission to access this resource.
The other end points are working fine.
Solution:
Thanks to #ronanq. the "payroll.payitems" needed to be added as a scope on Authorization. That will give access to get the LeaveTypes from xero

You can retrieve leave types and their associated LeaveTypeIDs from the PayItems endpoint.

Related

Synchroteam Api integration in PHP Wordpress form

I have this in a Wordpress Site and I need to integrate it with Synchroteam Api and send its fields to Synchroteam. I asked my client for the APIs and he sent me this email.
Client: "We have open APIs available . Please visit https://api.synchroteam.com/
Also to access your account through the APIs they would need the authentication key.
Please go into configuration => More => (LHS Down) Authentication Key."
https://api.synchroteam.com/ I have checked this link here is so many APIs I don't know which to use. Please Help.
The form is here.
As par your requirement you need to two API endpoint.
customer endpoint. Using this endpoint you can save all filed except Upload Printer status page and Upload sample page.in this endpoint response you get customer id.
attachments endpoint.pass customer id(you get in the first endpoint) in this endpoint.
if you need more help then comment.

sandbox error credentialas?

I am new to paypal and use sanbox.
I'm trying to implement the paypal payment platform on an online sales page and I get an error; When creating an app in developer paypal (generates my client id and its normal secret) and use it on the page I get the following error;
PayPalConnectionException in PayPalHttpConnection.php line 154:
Got Http response code 401 when accessing
https://api.sandbox.paypal.com/v1/oauth2/token.
But if I use a public credentials (taken from the internet) if it works and I redirect to paypal correctly ..
What am I doing wrong? I need something to check
Thanks in advance
Use a package like anouar/paypalpayment or omnipay/paypal and it will be much easier for you to implement it.
You need to create sandbox account, your regular account not work on sandbox, search on google for sandbox account for test, you can even create buyers with money on the account to simplify your tests.
yes friends, I understand that I had to create a Sandbox account and so I did and still does not work when creating my app.
I am creating an application in laravel and I need the cliend id and the secret of a sandbox api that is why I am trying to implement this method. I hope to see if anyone can come up with a way to solve this problem.
Why does not my account generate a valid client id? Why does any other internet work?

MailChimp API V3 Creating Interest (group)

I have a web app written in PHP that uses Mailchimp API v3. It was working ok until two days ago. I can't figure out what is going on. When I try to create new interest, I get 500 error, so in my response I don't get interest ID which I use later on. However, the interest gets created, which is weird.
I use the correct ENDPOINT. It's the same one shown in the API Playground. Even when I try to do this in the PLAYGROUND, I get the same error, but the interest (group) gets created.
Endopoint:
"http://".$dc.".api.mailchimp.com/3.0/lists/".$list_id."/interest-categories/".$subgroup_id."/interests"

Allow access to salesforce from any domain using php

I am a newbie to Salesforce and need to allow access to it using my website.
I have gone through the documentation provided by salesforce but it did not help.
https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_oauth_web_server_flow.htm&language=en_US
Actually I have developed a php website using codeignator and the requirement is, it needs to redirect users to salesforce.com for authorization, after authorization the application returns back to the website and from then I can add users as leads to salesforce directly from my website.
But when I try to connect to sales force as per the documentation given in the above link, it is throwing errors as shown below
error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
I have signed up for a development account with salesforce.com but the users using this app will have enterprise edition and each user will have its own salesforce product, so how to implement this using one client_id or say my client_id and my redirect url which is defined in my salesforce account, is very confusing, so I am writing it here.
Please help me with this how to allow access to individual salesforce accounts using php, any help is greatly appreciated, also please let me know if I am not clear with my requirement.
Thanks in advance.

Salesforce REST Api missing fields with PHP

I'm using the Salesforce REST API and found it very hard to find decent documentation.
I can successfully log in with OAuth and i can push new accounts to Salesforce.
I use the instance url to make the API calls and i send the following fields to create an account object:
Name
Rating
Description
The problem is that I created a free trial (which sits on na9.salesforce.com) and everything worked fine.
I created a second free trial to check if everything works with another account, but the rating field is not available... I get the following message from Salesforce:
"[{"message":"No such column 'rating' on sobject of Account"}]"
Why is that?
Also, is it possible to add notes to a created account using POST? And is it possible to create Leads instead of Accounts using the API?
Thanks in advance,
A feature called field level security (FLS) can mean that even standard fields are not accessible, check the FLS settings on account in your second org.
Docs for the REST API are on the developer force site

Categories