Create Project
This API is used to create the project for milestone transaction payments. Below are the fields that are to be sent via API using POST
Method to the Url:
For Staging: http://test-api.atarapay.com/api/project/createProject
for live: https://api.atarapay.com/api/project/createProject
Field name | Required | Description |
---|---|---|
authtoken | Yes | This is calculated using the steps mentioned here Calculation of Auth Token |
project_name | Yes | This is the name of the project |
description | Yes | This is a brief description of the project |
customer_email | Yes | Email address of the associated buyer |
customer_phone | Yes | Phone number of the associated buyer |
Successfull Response
{
"status": "success",
"message": "project_created",
"data": {
"project_name": "Escrow payment",
"description": "This project provides details on escrow payment creation.",
"started_by": null,
"seller_id": 120,
"customer_id": 281,
"updated_at": "2021-03-24 19:12:50",
"created_at": "2021-03-24 19:12:50",
"id": 1
}
}
Failure Response
{
"status": "error",
"message": "The authtoken field is required."
}
Sample codes
C#
var client = new RestClient("http://test-api.atarapay.com/api/project/createProject");
var request = new RestRequest(Method.POST);;
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "project_name=__project_name__&description=__project_description__&customer_email=__customer_email__&customer_phone=__customer_phone__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PHP
$request = new HttpRequest();
$request->setUrl('http://test-api.atarapay.com/api/project/createProject');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'content-type' => 'application/x-www-form-urlencoded'
));
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
'project_name' => '__project_name__',
'description' => '__project_description__',
'customer_email' => '__customer_email__',
'customer_phone' => '__customer_phone__',
'authtoken' => '__Auth_token_calculated__'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Node Js
var unirest = require("unirest");
var req = unirest("POST", "http://test-api.atarapay.com/api/project/createProject");
req.headers({
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
});
req.form({
"project_name": "__project_name__",
"description": "__project_description__",
"customer_email": "__customer_email__",
"customer_phone": "__customer_phone__",
"authtoken": "__Auth_token_calculated__",
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});