Ometria Library functions
$url='https://api.ometria.com/v2/contacts/default?limit=250&offset=0';
$getContacts=$ometrialibrary->getContacts(array("url"=>$url));
Functions used for particular standard use case
- Function: pushContacts($dataArray=array())
- In this function, pass two parameters.
- Payload:
$payload=[
[
"@add_to_lists"=> [5550],
"@type"=> "contact",
"@collection"=> "default",
"id"=> "annexsc.sa.sca.inttest@test.com",
"email"=> "annexsc.sa.sca.inttest@test.com",
"phone_number"=> "+919090909091",
"customer_id"=> "annexsc.sa.sca.inttest@test.com",
"prefix"=> "Mrs",
"firstname"=> "test",
"middlename"=> "V",
"lastname"=> "Annexcloud"
]
];
- Api: $url=’https://api.ometria.com/v2/push’;
- Based on the below format, you have to call the function:
- $pushContacts=$ometrialibrary->pushContacts(array("data"=>$payload,"url"=>$url));
- Function: getContacts($dataArray=array())
- For this function, pass one parameter.
$url='https://api.ometria.com/v2/contacts/default?limit=250&offset=0';
$getContacts=$ometrialibrary->getContacts(array("url"=>$url));
- Function: getContacts($dataArray=array()) :
- For this function, pass one parameter.
$id='annexsc.sa.sca.int1@test.com';
$url='https://api.ometria.com/v2/contacts/default/'.$id;
$getContact=$ometrialibrary->getContacts(array("url"=>$url));
Get All Segment List
- Function: getSegments($dataArray=array()):
- For this function, pass one parameter.
$url='https://api.ometria.com/v2/lists';
$getSegments=$ometrialibrary->getSegments(array("url"=>$url));
Create Order By Email
- Function: createOrder($dataArray=array()):
- Payload:
$payload=[
[
"customer"=> [
"id"=> "annexsc.sa.sca.int1@test.com",
"email"=> "annexsc.sa.sca.int1@test.com",
"firstname"=> "Test",
"lastname"=> "Annexcloud"
],
"channel"=> "online",
"shipping_address"=> [
"city"=> "London",
"state"=> "Greater London",
"postcode"=> "W1K 4TG",
"country_code"=> "GB"
],
"billing_address"=> [
"city"=> "London",
"state"=> "Greater London",
"postcode"=> "W1K 4TG",
"country_code"=> "GB"
],
"@type"=> "order",
"id"=> "123558",
"timestamp"=> "2022-08-31T09:00:00+00",
"subtotal"=> 83.33,
"discount"=> -5,
"shipping"=> 2,
"tax"=> 16.07,
"currency"=> "GBP",
"@merge"=> true,
"status"=> "complete",
"is_valid"=> true,
"ip_address"=> "127.0.0.1",
"store"=> "example.com/en",
"payment_method"=> "card",
"shipping_method"=> "standard",
"coupon_code"=> "FJ45-TJ5Y-5YK3-T894",
"grand_total"=> 97,
"web_id"=> "891743"
]
];
- Api: $url=’https://api.ometria.com/v2/push’;
- Like below format you have to call function:
$createOrder=$ometrialibrary->createOrder(array("data"=>$payload,"url"=>$url));
Get Order By ID
- Function: getOrderById($dataArray=array())
- For this function, pass one parameter.
$id=123558;
$url='https://api.ometria.com/v2/orders/'.$id.'?limit=10&offset=0';
$getOrder=$ometrialibrary->getOrderById(array("url"=>$url));
All Orders
- Function: getAllOrders($dataArray=array())
- For this function, pass one parameter.
$url='https://api.ometria.com/v2/orders';
$getAllOrders=$ometrialibrary->getAllOrders(array("url"=>$url));
All Orders with Date
- Function: getAllOrdersWithDate($dataArray=array())
- For this function, pass one parameter.
$url='https://api.ometria.com/v2/orders?limit=5&offset=0&since=2022-09-
0100%3A00%3A00&before=2022-09-0200%3A00%3A00';
$getOrdersWithDate=$ometrialibrary->getAllOrdersWithDate(array("url"=>$url));
Get List Collections
- Function: getListCollection($dataArray=array())
- For this function, pass one parameter.
$url='https://api.ometria.com/v2/contacts?limit=250&offset=0';
$getListCollection=$ometrialibrary->getListCollection(array("url"=>$url));
Get Specific Segment Details
- Function: getSegmentWithId($dataArray=array())
- For this function, pass one parameter.
$id='963fbf9f2ab2';
$url='https://api.ometria.com/v2/lists/'.$id;
$getSegmentWithId=$ometrialibrary->getSegmentWithId(array("url"=>$url));
Get Profile UpdateSince
- Function: getProfileUpdateSince($dataArray=array())
- For this function, pass one parameter.
$url='https://api.ometria.com/v2/profiles/?limit=10&offset=0&updateSince=2022-09-
0100%3A00%3A00';
$getProfileUpdateSince=$ometrialibrary->getProfileUpdateSince(array("url"=>$url));
Get Profile List
- Function: getProfileList($dataArray=array())
- For this function, pass one parameter.