MOR API Services get

From Kolmisoft Wiki
Revision as of 19:27, 16 May 2017 by Ervinas (talk | contribs) (→‎Request)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

NOTE: Available from MOR X5

Description

MOR API Services get

Usage

  • From MOR X5 Call: /api/services_get
  • Methods: POST, GET(if allowed, not recomended)



Parametres



Request

We have: API Secret Key = 123456

We send:

HTML POST: http://<SERVER_IP>/billing/api/services_get?u=admin&hash=7c4a8d09ca3762af61e59520943dc26494f8941b

NOTE that username is not included in hash

Success

<page>
 <services>
   <service>
     <id>1</id>
     <name>Test_periodic_service</name>
     <memo>Comment</memo>
     <type>periodic_fee</type>
     <period>month</period>
     <price>10.0</price>
     <self_cost>0.0</self_cost>
     <currency>USD</currency>
     <quantity>1</quantity>
   </service>
   <service>
     <id>2</id>
     <name>Test_one_time_fee_service</name>
     <memo>Comment2</memo>
     <type>one_time_fee</type>
     <period></period>
     <price>12.0</price>
     <self_cost>0.0</self_cost>
     <currency>USD</currency>
     <quantity/>
   </service>
   <service>
     <id>3</id>
     <name>Test_flat_rate_service</name>
     <memo>Comment3</memo>
     <type>flat_rate</type>
     <period></period>
     <price>1.0</price>
     <self_cost>0.0</self_cost>
     <currency>USD</currency>
     <quantity>1</quantity>
   </service>
 </services>
</page>




Errors

  • <error>No Services found</error> - Service was not found using specified ID. Use correct ID.
  • <error>You are not authorized to manage Services</error> - Such username does not exist in the database or User does not have rights to manage Services.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key while concatenating hash_string.



See also