Update Project
This API is used to update project. Find below the list of parameters that are needed to be sent via the API using the PUT
Method to the Url:
For Staging : http://test-api.atarapay.com/api/project/updateProject/{project_id}
For Live : https://api.atarapay.com/api/project/updateProject/{project_id}
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 |
project_id | Yes | This is the Project Id that is generated when a Project is created |
Successfull Response
{
"status": "success",
"message": "project_updated",
"data": {
"id": 1,
"seller_id": 120,
"customer_id": 281,
"project_name": "Eko Atlantic city",
"description": "This is a building project that requires milestone payments.",
"started_by": null,
"status": 0,
"created_at": "2021-03-24 20:35:47",
"updated_at": "2021-03-24 20:45:43",
"transaction": []
}
}
Failure Response
{
"status": "error",
"message": "Project with id (1) does not exist"
}
Sample codes
C#
var client = new RestClient("http://test-api.atarapay.com/api/project/updateProject/{project_id}");
var request = new RestRequest(Method.PUT);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "authtoken=__Auth_token_calculated__&project_name=__project_name__&description=__project_description__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PHP
$request = new HttpRequest();
$request->setUrl('http://test-api.atarapay.com/api/project/updateProject/{project_id}');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'content-type' => 'application/x-www-form-urlencoded'
));
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
'authtoken' => '__Auth_token_calculated__',
'project_name' => '__project_name__',
'description' => '__project_description__'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Node Js
var unirest = require("unirest");
var req = unirest("PUT", "http://test-api.atarapay.com/api/project/updateProject/{project_id}");
req.headers({
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
});
req.form({
"authtoken": "__Auth_token_calculated__",
"project_name": "__project_name__",
"description": "__project_description__"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});