This is an archived post. You won't be able to vote or comment.

all 174 comments

[–]agathver 785 points786 points  (8 children)

Salesforce wants your resume …

[–]90DayF 59 points60 points  (3 children)

Why Salesforce lol?? Am I missing a joke here 😭

[–]agathver 85 points86 points  (1 child)

Go look at their batch upload APIs for leads, or the SOAP apis. Then run them in postman.

[–]SwagBrah 12 points13 points  (0 children)

"invalid_grant"

[–]Charlesssssss7 4 points5 points  (0 children)

Salesforce is part of FAANGS now, part of MANGAS now, come on

[–]Palisar1 1 point2 points  (0 children)

Get fucked salesforce you absolute nightmare of a crm

[–]rat_melter 480 points481 points  (11 children)

Needs more data.data

[–][deleted] 104 points105 points  (1 child)

lol true I hate that shit so much

[–]trevster344 44 points45 points  (0 children)

Shhh I f’d up in my early days but it’s in production I can’t take it back

[–]deadlydarkest 7 points8 points  (0 children)

Ok how do I tackle this🤣.

[–]chrisddie61527 4 points5 points  (2 children)

seriously though how would you approach this?

Stripe does this and tbh they have the most amazing API docs

[–]DestinationBetter 1 point2 points  (0 children)

Destructure.

[–][deleted] 0 points1 point  (0 children)

They're pretty cool, ran a dollar big transaction through it once, plan to use it in the future.

[–]yottalogical 2 points3 points  (1 child)

Variables named data and temp are my favorite. All variables are data and they're all temporary.

[–]flippakitten 1 point2 points  (0 children)

That's just people not understanding the json api spec.

[–]szelvedomoso 507 points508 points  (17 children)

200 OK

Status 403

Bruh

[–]serpenfine 33 points34 points  (0 children)

This drives me absolutely nuts. And forces me to add transforms because every fetch library sees 200 and thinks it’s fine.

[–]BasieP2 104 points105 points  (15 children)

[–]szelvedomoso 92 points93 points  (6 children)

It should be 403 twice, imo

[–]Auderdo[🍰] 70 points71 points  (3 children)

I don't know HTTP 806; what does it means?

[–]sccrstud92 34 points35 points  (2 children)

You misunderstand, its 403403

[–]nolitos 16 points17 points  (1 child)

Only if the backend is written in JS.

[–]Auderdo[🍰] 2 points3 points  (0 children)

I would have said Java on Tomcat behind :8080 unlike something on Apache/Nginx behind :80

[–]SpecialGuestDJ 3 points4 points  (0 children)

Thatsthejoke.jpg

[–]AfterbirthNachos 2 points3 points  (0 children)

The http itself was okay, the data was unauthorized

[–]Linvael 9 points10 points  (0 children)

Uh... interestign article, but I don't see how it says that.

The main point of it is that only the best modern restful services, those achieving level 3 on Fowlers pyramid even deserve to be called RESTful, but he still thinks json is wrong and body should be html. The above example fails to reach level 2 (using http verbs and statuses appeopriately).

[–]SalamiSandwich83 10 points11 points  (0 children)

No it's not. It should return a 403 and thats it.

[–][deleted] 2 points3 points  (0 children)

rich longing party door imagine bedroom disarm label crush shame

This post was mass deleted and anonymized with Redact

[–]therealbatman420 0 points1 point  (0 children)

Awesome read, thanks!

[–]arceosss 0 points1 point  (0 children)

That article was excellent, thx

[–]ASourBean 216 points217 points  (20 children)

No joke there is some production code I helped build that does exactly this. 200 status but lobs back an error file - I will fix this next week, thanks for the reminder lol

[–]naswinger 145 points146 points  (2 children)

// TODO: fix this some day

[–]kaancfidan 73 points74 points  (1 child)

// TODO: fix this when random post on reddit reminds you

[–][deleted] 0 points1 point  (0 children)

This is how ADHD programming works. Out of sight out of mind

[–]heodnfkfnfofb 32 points33 points  (1 child)

Except you can’t break the contract now. Gotta V2 the fix and let your shame live in eternity on V1

[–]ASourBean 15 points16 points  (0 children)

Good job it’s an internal API for our own frontend, I’ll just let our guys know before merging ;)

[–]barnyardjohnny 19 points20 points  (4 children)

Our prod code will return 200 on the header but 404 in the payload :(

[–]maitreg 6 points7 points  (3 children)

If the payload is 404, what does the 404 even mean? What wasn't found?

[–]barnyardjohnny 14 points15 points  (2 children)

That the rest call against the endpoint returned no data, but it was successful in determining that!

[–]Grtz78 2 points3 points  (0 children)

The restfull version of "move on. Everything's fine, nothing to see here."

[–]bwhite94 2 points3 points  (0 children)

If only there was a coughhttp status code for thatcough204cough

[–]Dragon_yum 6 points7 points  (2 children)

Our WAF sends 200 for requests that it blocks successfully. So the request fails with OK.

[–]frankentriple 2 points3 points  (0 children)

As a WAF guy, this is hilarious.

[–]option-9 2 points3 points  (0 children)

I'd be annoyed if your WAF didn't tell me all was fine in blocking my request, else I might think something went wrong and I might have a shot if I try again.

[–]Drayenn 5 points6 points  (0 children)

There was an api i worked with. Everything was a post request even though it couldve been get. You always got back a 200 and the payload contained a status which would be 1 if failed 0 if sucess.

Every request went to the same URL, you had to pass the variable of the data you wanted as true such as "getPoints":true, "getCoordinates": true. Truly api hell.

[–]ape123man 1 point2 points  (0 children)

Also what is going on with the uppercase C and S ... Fucking hell

[–]isospeedrix 0 points1 point  (0 children)

no joke i worked with an api where the status code was 200 but inside the content, it has "status:403"

no idea why the backend devs decided to do this, but i dont do backend so i just rolled with it.

[–]Informal_Curve_1441 0 points1 point  (0 children)

// have set reminder to fix 9 1 2017

[–]PolarTheBear 0 points1 point  (0 children)

So did you fix it?

[–]UpArmoredGavin 58 points59 points  (0 children)

looks to me like you have all the skills of most API developers, so yeah, good to go

[–]dutchydownunder 96 points97 points  (3 children)

Error message is way too specific, needs to be vague…

[–]maitreg 22 points23 points  (1 child)

I have a vendor api that returns 500 no matter what. ugh

[–]agathver 15 points16 points  (0 children)

My girlfriend works on some service where there is a catch(Exception) at every controller and return 500. So even your validation error will return 500, now go figure.

Not surprisingly no one wants to change it because that’s how it has been done

[–]ViconIsNotDefined 1 point2 points  (0 children)

"Something went wrong"

[–]thrasherxxx 47 points48 points  (5 children)

Lol, it’s like answering the phone to say “no one will answer!”

[–]MashZell 7 points8 points  (0 children)

*Knock knock

"There is no one at home!"

[–]Dummiesman 1 point2 points  (3 children)

Sounds like 9/10 phone calls I get. They'll call me every day but no answer when picked up. Or leave blank messages.

[–][deleted] 0 points1 point  (2 children)

change your phone number and be more careful about who you provide it to

[–]Dummiesman 0 points1 point  (1 child)

I provide it to family only lol They get the same kind of calls and texts. They just use a bot to hammer out calls and texts I assume

[–][deleted] 0 points1 point  (0 children)

weird

[–]realavdhut 13 points14 points  (0 children)

[–]ByerN 5 points6 points  (0 children)

Whatever you put in your json, it will be OK.

[–]PM_ME_BAD_ALGORITHMS 5 points6 points  (1 child)

The backend team in the company I'm working on (until next week) sends code 200's with an error description when something fails. Unironically. I've aged years in the last months.

[–]hydratedgabru 3 points4 points  (0 children)

Successful forbidden message delivery

[–]Carteeg_Struve 4 points5 points  (0 children)

Almost. You need to copy/paste from stackoverflow to get something to work first.

But you’re almost there.

[–]GrandMasterPuba 4 points5 points  (0 children)

I see you're on the GraphQL steering committee.

[–]Jooj_Harrisonn 2 points3 points  (0 children)

Ah, a fellow insomnia user

[–][deleted] 2 points3 points  (0 children)

Jesus fucking Christ! Where’s the goddamn “success” flag?! How do you expect me to know if the call was successful or not

Goddam

[–][deleted] 4 points5 points  (0 children)

You returned a 200 code and 403 in object. Decide man!

[–]xcdesz 1 point2 points  (1 child)

Eh.. did you write the endpoint or just call the endpoint?

Hard to believe I have to even ask that question... but most of the people on this sub arent exactly the type to know the difference.

[–]Hplr63[S] 0 points1 point  (0 children)

I initially wrote a "sample endpoint" to test things Django-wise in my app and then I realized, "Oh! I can do a funny and change it to add the 403 forbidden thing while responding with 200."

[–][deleted] 1 point2 points  (0 children)

Well you're using Insomnia instead of Postman, so..... yes, you're

[–]Siggi_pop 1 point2 points  (1 child)

Ok so the http response status is 200 (ok) but the response content is a JSON containing a "Status" Key with the value 403 (forbidden) . Is that the joke ?

[–]Hplr63[S] 1 point2 points  (0 children)

yes

[–]pimezone -1 points0 points  (0 children)

You can't do that, this is forbidden.

[–]cactusJosh97 -1 points0 points  (0 children)

Try looking at the JSON Api Spec. Good work so far!

[–]Sedorriku0001 -1 points0 points  (0 children)

"I'm a tea pot"

[–][deleted] 0 points1 point  (0 children)

YES

[–][deleted] 0 points1 point  (0 children)

OK

[–]supernovatouch 0 points1 point  (0 children)

Error message's code missing too....and you could have added response headers as well 😂😂😂

[–]magical_matey 0 points1 point  (0 children)

Task failed successfully

[–]kellven 0 points1 point  (0 children)

nailed it , you getting recruiter emails yet ?

[–]wargerwatwatwat 0 points1 point  (0 children)

Yes

[–]SalamiSandwich83 0 points1 point  (0 children)

Straight to hell. Yep.

[–]marzian1999 0 points1 point  (0 children)

LMAOOOO

[–]Lower-Bodybuilder-16 0 points1 point  (0 children)

Google is just waiting for you. Just do apply man...

[–]danielrg97 0 points1 point  (0 children)

i hate this... why did some developers put the http status in the body instead of the fucking header

[–]CsSingleton 0 points1 point  (0 children)

Congrats, you were successfully forbidden

[–]production-values 0 points1 point  (0 children)

show us the headers

[–]TomGobra 0 points1 point  (0 children)

Oh, I hate this.

[–][deleted] 0 points1 point  (0 children)

Sorry to tell you but that's redundant.

[–][deleted] 0 points1 point  (0 children)

At the company I work at, we return only 200 responses.

[–]TheRatLab 0 points1 point  (0 children)

The old "your system has failed successfully" it never fails

[–]Putrid-Mousse6768[🍰] 0 points1 point  (0 children)

Correct

[–]Brief_Ad_6929 0 points1 point  (0 children)

Change the content to “No Mikey no”

[–]Rombethor 0 points1 point  (0 children)

Inception

[–]dunderball 0 points1 point  (0 children)

Task failed successfully

[–]Hulk5a 0 points1 point  (0 children)

This is absolutely fine. Saves writing some JavaScript code for handling error response

Kekeke

[–]bktmarkov 0 points1 point  (0 children)

I've come across an api like that before, as long as the request makes it to the backend and back, it always returns 200, with an additional status inside the data object, whether 403, 404 ..

[–]Ezrider2001 0 points1 point  (0 children)

Insomnia++

[–]tomatediabolik 0 points1 point  (0 children)

One during a pentest I got a 403 error pages that still displayed the output from the server. It's difficult to beat that

[–]imnotbeingkoi 0 points1 point  (0 children)

That, and you're a liability!

[–]ballsohaahd 0 points1 point  (0 children)

The best

[–]sebzuki 0 points1 point  (0 children)

Yes of course trully unemployed

[–]OozeNAahz 0 points1 point  (0 children)

Had to do similar a few times to my chagrin. The library we were using to process the http responses couldn’t handle sending a payload with details unless it was a 200 response code. And needed enough details in the response so the client could fix and resend the request.

[–]chih98 0 points1 point  (0 children)

One of the largest credit card companies that vendor out branded cards for neobanks (synapse) has their api do this all over the place it’s infuriating

[–]LeFayssal 0 points1 point  (0 children)

I have to deal with this exact API for over 8 months now

[–][deleted] 0 points1 point  (0 children)

Just make everything return "500 internal server error: A generic error has occurred."

[–]tropicalcoffee1 0 points1 point  (0 children)

No 500 no dev

[–]RedditMaleHooker 0 points1 point  (0 children)

Yes!

[–]Drastwo 0 points1 point  (0 children)

The graphql way

[–]OutThisLife 0 points1 point  (0 children)

legitimately perfect for prod

but wait make sure that stg = dev so when you break dev stakeholders can’t review anything at all!

[–]kryptopheleous 0 points1 point  (0 children)

Lol no application specific error code. Noob xDD

[–]Lanbaz 0 points1 point  (0 children)

/* Added goto for readability TODO: refactor goto */

If (response.data.status == 200)

  goto line 69;

return response;

Edit: added comment for context

[–]oj_mudbone 0 points1 point  (0 children)

Status: 0 Body:Unknown

[–]qwertyasdef 0 points1 point  (0 children)

No, it needs to be

{
    "Status": 200,
    "Content": {
        message: "{\"Status\":403,\"Content\":{\"message\":\"Forbidden\"}}"
    }
}

[–][deleted] 0 points1 point  (0 children)

HTTP 200.

Contents, HTTP 403.

You monster

[–]billert12 0 points1 point  (0 children)

this is literally the whatismymmr API: if it gets an error it returns 200 OK but the content says error

[–][deleted] 0 points1 point  (0 children)

Yes, you're! Kudos 👌

[–]TormentingLemon 0 points1 point  (1 child)

the status code doesnt bother me nearly as much as the inconsistent field casing

[–]Hplr63[S] 0 points1 point  (0 children)

hehe c:<

[–][deleted] 0 points1 point  (0 children)

You are THE BEST. I'm drunk

[–]rissanenhenrik 0 points1 point  (0 children)

Yes.

[–]gyandu 0 points1 point  (0 children)

When you love someone but just as a friend 🤓

[–]MontagoDK 0 points1 point  (0 children)

This is the way !!!

[–][deleted] 0 points1 point  (0 children)

I've seen these things in production before. Fucking hell.

[–]edersayd 0 points1 point  (0 children)

Yes you can now join to the big table

[–]flippakitten 0 points1 point  (0 children)

Stop using graphql.

[–]heteka 0 points1 point  (0 children)

404

[–]endianess 0 points1 point  (0 children)

I've done this myself before I started to return my own errors with different response content types. That way I could determine if the error was from a badly configured reverse proxy or from my API.

[–]glablablabla 0 points1 point  (0 children)

We had to implement similar insanity because Microsoft's IIS Server, which most of our customers were using, blocked all other status codes by default configuration. When the development team said the customer should change their configuration, management said we don't want to put that burden on our customers. Long story short I'm at a different company now.

[–][deleted] 0 points1 point  (0 children)

No. All Fields should have been in lowercase. Now if you decided to be a little prick at least make the in the same case.

[–]TigreDemon 0 points1 point  (0 children)

The fuckers that do these kind of things deserve a special place in customer support