0

I got an API endpoint that I need work with that looks like something below (it's a POST request) which revolves around uploading images to a server.

Does the parameters: part mean that the URL should be populated with whatever the user has uploaded upon form submission (upon clicking submit)? For example: www.website.com/upload_identifier=398/File=abc12 ? where upload_indentifier & File are user driven and that it needs to reflect in the URL? I think not because GET requests populate URL rather than POST requests.

I just want to know if I'm reading this correctly before diving in. Thanks for reading.

parameters:
- upload_identifier
- File

Response code: 200 - success
{
    "isValid": true,
    "message": "Succuesfully complete request",
}
Response code: 200 - error
{
    "isValid": false,
    "message": "Access Denied. Invalid Credentials. Contact your administrator",
    "code": "0",
    "message": "Access denied",
    "message": "Access denied",
}
Response code: 400 - error
{
    "isValid": false,
    "message": "Invalid file type" / "File too large",
    "code": "5",
    "message": "Error in expected params",
    "message": "There are missing or invalid parameters than expected"
}
Response: 400 - error
{
    "isValid": false,
    "message": "Request already processed",
    "code": "6",
    "message": "Record already exists",
    "message": "Record already exists"
}
cloudyday
  • 183
  • 6
  • No, not in the url, that's for GET requests. Maybe [this question](https://stackoverflow.com/questions/22355828/doing-http-requests-from-laravel-to-an-external-api) can be of help. – El_Vanja Apr 04 '20 at 17:17
  • @El_Vanja yes, I mentioned that that's for GET requests in my post :). I'm just curious as to how I should use these parameters. I'm trying to find an example online revolving around POST requests using parameters. – cloudyday Apr 04 '20 at 17:23
  • The second and fourth answer in that linked question are using `'form_params'`, as well as the answer to [this question](https://stackoverflow.com/questions/27825667/php-guzzlehttp-how-to-make-a-post-request-with-params). – El_Vanja Apr 04 '20 at 17:32

0 Answers0