Campaign

This will create new campaign for Ayobantu partner themself.

Create Campaign

POST {base_url}/api/v1/partner/campaign

Create new campaign to partner account in Ayobantu

Headers

NameTypeValue

Authorization

String

Bearer <api_token>

Content-Type*

String

multipart/form-data; boundary=<calculated when request is sent>

Request Body

NameTypeDescription

title*

String

Marathon Run (Alpha/Numeric Only) and 3-100 characters

category*

Numeric

1=Bencana; 2=Sosial; 3=Pendidikan; 4=Kesehatan; 5=Olahraga; 6=Kerohanian; 7=Kebudayaan; 8=Lainnya; 9=Lingkungan Hidup

campaign_image*

File

Max. 1MB (.jpg/.jpeg/.png/.webp). Image will be resized to 800x800 automatically by system

campaign_banner*

File

Max. 1MB (.jpg/.jpeg/.png/.webp). Image will be resized to 1280x720 automatically by system

partner_code*

String

Provided by Ayobantu. See more, click here

signature_key*

String

Signature code generated every time you make a request. See more, click here.

Formula:

hash("sha512", title + category + partner_code + secret_key);

Example Output: fc4152dcc06f4487b022883d3118b2aa81996e0e697bb1550b9e83beacea4f76fd772c2f9fe4b77974bef1c39e183c9530affb66fbbf5320f3d6df571ed472e2

description (Optional)

String

10-100.000 characters

target_donation (Optional)

Numeric

1.000.000 to 100.000.000 (default 1.000.000)

minimum_donation (Optional)

Numeric

10.000 to 1.000.000 (default 10.000)

expired_at (Optional)

Unix timestamp

Campaign end date. (default 30 days from time submit)

Example: 1732163756

beneficiary_information (Optional)

String

5-100.000 characters

{ 
   "status_code": "200", 
   "message": "Success", 
   "data": {
         "campaign_id" : 1818,
         "campaign_link" : "https://ayobantu.com/marathon-run"
   } 
}
// Example Generate Signature Key 
//secret_key = '353656da-1695-434b-9f61-a3c9ff90894f';
hash("sha512", 'Marathon Run2AYB12345353656da-1695-434b-9f61-a3c9ff90894f')

//Result
01b2eb96f63a74f46ccc2431952b39b6704dce330ad611d9ede62e70c27a954e696a503941ae4cbf0262686825cd004a1afa624d3fe6a1513910dc2b5cd4b81e
curl 
    --location --request POST {base_url}'/api/v1/partner/campaign' \
    --header 'Authorization: Bearer 88A4B7FEADD1667B' \
    --form 'title="Marathon Run"' \
    --form 'category="3"' \
    --form 'campaign_image=@"/Downloads/illustrator/image.jpg"' \
    --form 'campaign_banner=@"//Downloads/illustrator/banner.jpg"' \
    --form 'partner_code="AYB12345"' \
    --form 'signature_key="01b2eb96f63a74f46ccc2431952b39b6704dce330ad611d9ede62e70c27a954e696a503941ae4cbf0262686825cd004a1afa624d3fe6a1513910dc2b5cd4b81e"'
    --form 'description="campaign ini merupakan bagian dari contoh"' \
    --form 'target_donation="2000000"' \
    --form 'minimum_donation="10000"' \
    --form 'expired_at="1732163756"' \
    --form 'description="campaign ini merupakan bagian dari contoh"'

Last updated