SOAP API: Forskjell mellom sideversjoner
Linje 16: | Linje 16: | ||
$header = new \SoapHeader('auth', 'UsernameToken', $auth, true); | $header = new \SoapHeader('auth', 'UsernameToken', $auth, true); | ||
</pre> | </pre> | ||
= Complex datatypes = | |||
The following complex types are used. Please see the wsdl for details. | |||
*Product | |||
*ArrayOfProduct | |||
*Item | |||
*ArrayOfItem | |||
*Unit | |||
*ArrayOfUnit | |||
*Quotation | |||
= Available services = | = Available services = |
Sideversjonen fra 4. mai 2015 kl. 22:32
SOAP API er laget primært for integrasjon med Visma.
Lokasjon
Adresse: http://prosjektkalkulator.no/soap?wsdl
Innlogging
Tilgang til SOAP API er kun tilgjengelig med egne brukerkontoer opprettet for SOAP. En slik konto kan opprettes av brukerne av systemet på siden Innstillinger->Brukere
Opprett en SOAP header med navn 'UsernameToken'. Den skal ha to attributter: 'Username' og 'Password'. Hvis clienten håndterer sessiondata så tror jeg innlogging er bare nødvendig på første kall, men jeg har ikke testet det. Det sikre er vel å ta med headeren på alle forsespørsler.
Eksempel i PHP:
$auth = new \stdClass(); $auth->Username = 'brukernavn'; $auth->Password = 'passord'; $header = new \SoapHeader('auth', 'UsernameToken', $auth, true);
Complex datatypes
The following complex types are used. Please see the wsdl for details.
- Product
- ArrayOfProduct
- Item
- ArrayOfItem
- Unit
- ArrayOfUnit
- Quotation
Available services
helloWorld
Description
Used for testing. Does not require login.
Request
Parameter | Type | Mandatory/Optional | Comments |
---|---|---|---|
void |
Response
Name | Type | Description |
---|---|---|
string | The string "Hello World!" |
getQuotationById
Description
Get a Quotation. The object is returned with the related objects Unit, Item and Product populated.
Request
Parameter | Type | Mandatory/Optional | Comments |
---|---|---|---|
id | int | Database table primary key |
Response
Name | Type | Description |
---|---|---|
return | Quotation | Complex type Quotation |
getQuotationByCustomId
Description
Get a Quotation by the Quotation number chosed by the user. Custom id is unique within each group/company. The object is returned with the related objects Unit, Item and Product populated.
Request
Parameter | Type | Mandatory/Optional | Comments |
---|---|---|---|
id | int | custom_id field. |
Response
Name | Type | Description |
---|---|---|
return | Quotation | Complex type Quotation |
getProductSummaryByQuotationId
Description
Returns a list of all the products related to a Quotation. Products of same efonumber, description and price are added together.
Request
Parameter | Type | Mandatory/Optional | Comments |
---|---|---|---|
id | int | Database table primary key |
Response
Name | Type | Description |
---|---|---|
return | array <Product> | Array of complex type Product |
getProductSummaryByQuotationCustomId
Description
Returns a list of all the products related to a Quotation. Products of same efonumber, description and price are added together. Custom id is unique within each group/company.
Request
Parameter | Type | Mandatory/Optional | Comments |
---|---|---|---|
id | int | custom_id field |
Response
Name | Type | Description |
---|---|---|
return | array <Product> | Array of complex type Product |