SoftLayer API: how to create a ticket - api

I am trying to create a SoftLayer ticket on behalf of customers, want to set assignedUserId and assignedEmployeeId, make the first update by employee id.
I tried to use client['Ticket'].createStandardTicket, but assignedEmployeeId was not set properly. Do you know how to get this implemented? Thank you so much in advance.

Unfortunately you won’t be able to assign an employee id since this parameter isn’t available in: http://sldn.softlayer.com/reference/datatypes/SoftLayer_ticket http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/createStandardTicket
http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/createAdministrativeTicket
This kind of tasks are managed by employees and it is an internal subject.

Related

How to add data to res.partner fields for mlutiple companies via API

I'm trying to add account payable and receivable fields for a partner in Odoo via API. However, they are only being applied to the default company. I hope the following images clarify.
How it appears for our default company :
How it appears for the other company :
I'm creating a partner as follows :
user_id = models.execute_kw(db, uid, password, 'res.partner', 'create', [{'name': name,'email':email,'company_id': odoo_company_id,'property_account_payable_id':account_payable_id,'property_account_receivable_id':account_receivables_id,'property_product_pricelist':pricelist_id}])
Any idea how this can be done ? Thanks in advance.
Those are properties and values are stored in ir.property objects. You probably have to write those entries for each company.
Remember that accounts are company-depending objects as well, so you cannot use same account.account object to every company. They are different objects with different ids in database even if accounts may have same code and name and you cannot see any difference on user interface.
You can also define default property for each company, if that is what you want. It can be done through GUI.

Xero previewer not displaying Employees

I am setting up a Xero payroll integration using an Australian demo company. I have set up a private api key and using the previewer to check the responses to retrieving all employees.
There are 6 test employees and when I use the following endpoint https://api.xero.com/api.xro/2.0/employees no employee data is returned but I get a 200 response.
If I post data through the Previewer using the same endpoint, contacts are successfully created but are not in the Payroll Employees list but rather in the contacts list.
Using a get on the above endpoint after this point will then return any Employee created through the Post in the Previewer. Those alone.
When I set up the API key there was an option to enable for Payroll and I did do this.
Anyone know why I'm not getting the 6 Employees in the Employee list please?
Many thanks
Cath
found it: wrong endpoint was being used. This was the correct one.
https://api.xero.com/payroll.xro/1.0/Employees

Retrieve customer related to payment

Anyone know if it's possible to retrieve the customer name related to a transaction from the API?
I see it under "Paid by" if I follow the "payment_url" in the connect v1 https://connect.squareup.com/v1/{{location_id}}/payments/{{payment_id}} endpoint but can't see to find it anywhere else
Background: I'm working on a ticketing system that breaks out items by item_category so a kitchen gets only food items and the bar gets only drink items.
I have queues and itemized tickets by category BUT I can't seem to find the customer's name anywhere
You'll need to utilize the V2 Transactions API. When you call ListTransactions or RetrieveTransaction (ListTransactions), the Transaction object will have an array of Tenders, tenders, which has a field called customer_id. With this id, you will be able to pass it to RetrieveCustomer (RetrieveCustomer) to find out their name. Note that if you're not explicitly filling out their name, the name might not be available (an "instant profile" (Instant Profiles) will be created with whatever information can be retrieve from the card used to pay).
Update: Alternatively, as suggested by #Dan, would be to strip the payment_url from a V1 RetrievePayment (RetrievePayment) which includes the transaction_id at the end of the URL: https://squareup.com/dashboard/sales/transactions/TRANSACTION_ID. This is more efficient as you won't need to loop through transactions, and allow you to send it straight to RetrieveTransaction.

Softlayer API: Is it possible to get a related orderId with the ticketId?

What I'm trying to do is to get a related order id after installing security SW through ticket.
Actually I've seen the following API Account-getUpgradeRequests.
SoftLayer_Account::getUpgradeRequests
But this API seems to be appliable to only "Sales" group tickets.
How can I get an related order Id from "Support" group tickets? What API I shoud use?
Well basically, the method returns all the upgrade requests. When you upgrade a device this ticket is created automatically and it contains the orderId for your upgrade request.
The upgrade requests are usually created using the groups: "Hardware" or "Sales".
So, I do not know how your ticket was generated, but If you created manually the ticket with a orderId in the "ticket body" field, the getUpgradeRequests will not list that ticket, and there is not any method which lists that. You could list all the tickets and look up in their body the orderID.

Organising resource (URI) in REST API

Scenario 1
In my web application say for there is a screen for adding an employee to system. As soon as user tabs after entering name of the employee, it generates the employee code automatically (which is the next field) based on some logic and already present records in the database.
Now I want to expose rest API for this application so that third party devs can build on top of it. So, I will have a resource called as /Employee which will respond for GET, PUT and DELETE verbs. But when a client needs to autofill the code, which is a GET operation, it will be on what resource? Should I make a new resource /EmployeeCodeFor/{Name} or I should get it on /Employee/{Name}/GenerateCode? If I go with /Employee/{Name}/GenerateCode then what about my resource to GET, PUT and DELETE for Employee i.e. actually /Employee/{Id}?
Scenario 2
Here lets take the case of a stackoverflow post. So lets say the resource would be /Post/{Id}. In the same way as in the previous example it lists me possible duplicate question as soon as I tab out of the Title field.
Again on what URL I should get those possible duplicates?
I can't think of more scenarios just now. But many such kind of scenarios may come up in real life application development. How to implement them in RESTful way?
Update on scenario 1
Code and Id are two different fields. Id is primary key, code can be duplicate across departments just to illustrate. Also to generate a code, name should be provided first. So, if user types a name "FirstName LastName" then server might generate FL003 as code assuming that there are already two more employees with firstname starting from F and lastname starting from L in the said department. Department can be identified based on the logged in user.
One way to allow the server an opportunity to pre-fill a bunch of elements in a new resource is to do
POST /Employees
{with empty body}
=>
201 Created
Location: http://example.org/employee/3443
<Employee Id="3443">
<Code>E1001</Code>
<FirstName></FirstName>
<LastName></LastName>
</Employee>
This gives the server one chance to provide default values. If you are looking for a more interactive way for the server to provide feedback during the input, I have another approach but it will take quite a bit more explaining.
Scenario 1
Let say your employee code is a unique identifier. In this case, to get it, you would allow the user to complete any field for the new employee and then make a POST. The server would generate the code and respond to the POST with a link to /Employee/{generated_code} which is the record for your newly created employee.
A GET on /Employee would return a list of all employees. A GET on /Employee/{a_code} will give you the employee detail.
Scenario 2
You could have some kind of query on the /Post collection like /Post?title_like={question_title}. A GET /Post?title_like=REST How to would return you a list of all questions containing "REST How to".