List of Error Codes for Facebook's API

facebook 曾经公布过这个列表, 但是后来删掉了. 千辛万苦找到了别人分享的东东, 存档备忘.

 

注: 最新的错误可能会没有

 

Overview

If you pass in a malformed or invalid API request, an error result gets returned. This is detectable by checking if the root element is of type error_response. Within this element, an error code and explanatory message are returned, as well as all of the parameter names and values of the original request.

In the example below, we see the error returned when an otherwise-valid request is made from an unauthorized IP address

Example Return XML

 
  
 
   
1 <? xml version="1.0" encoding="UTF-8" ?>
2   < error_response xmlns ="http://api.facebook.com/1.0/" xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation ="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" >
3 < error_code > 5 </ error_code >
4 < error_msg > Unauthorized source IP address (ip was: 10.1.2.3) </ error_msg >
5 < request_args list ="true" >
6 < arg >
7 < key > method </ key >
8 < value > facebook.friends.get </ value >
9 </ arg >
10 < arg >
11 < key > session_key </ key >
12 < value > 373443c857fcda2e410e349c-i7nF4PqX4IW4. </ value >
13 </ arg >
14 < arg >
15 < key > api_key </ key >
16 < value > 0289b21f46b2ee642d5c42145df5489f </ value >
17 </ arg >
18 < arg >
19 < key > call_id </ key >
20 < value > 1170813376.3544 </ value >
21 </ arg >
22 < arg >
23 < key > v </ key >
24 < value > 1.0 </ value >
25 </ arg >
26 < arg >
27 < key > sig </ key >
28 < value > 570dcc2b764578af350ea1e1622349a0 </ value >
29 </ arg >
30 </ request_args >
31   </ error_response >

 

Error Code Table

General Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
0API_EC_SUCCESSSuccess(all)
1API_EC_UNKNOWNAn unknown error occurred(all)
2API_EC_SERVICEService temporarily unavailable(all)
3API_EC_METHODUnknown method
4API_EC_TOO_MANY_CALLSApplication request limit reached(all)
5API_EC_BAD_IPUnauthorized source IP address(all)
6API_EC_HOST_APIThis method must run on api.facebook.com(all)
7API_EC_HOST_UPThis method must run on api-video.facebook.com
8API_EC_SECUREThis method requires an HTTPS connection
9API_EC_RATEUser is performing too many actions
10API_EC_PERMISSION_DENIEDApplication does not have permission for this action
11API_EC_DEPRECATEDThis method is deprecated
12API_EC_VERSIONThis API version is deprecated
13API_EC_INTERNAL_FQL_ERRORThe underlying FQL query made by this API call has encountered an error. Please check that your parameters are correct.
14API_EC_HOST_PUPThis method must run on api-photo.facebook.com
15API_EC_SESSION_SECRET_NOT_ALLOWEDThis method call must be signed with the application secret (You are probably calling a secure method using a session secret)
16API_EC_HOST_READONLYThis method cannot be run on this host, which only supports read-only calls
17API_EC_USER_TOO_MANY_CALLSUser request limit reached
18API_EC_REQUEST_RESOURCES_EXCEEDEDThis API call could not be completed due to resource limits

Parameter Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
100API_EC_PARAMInvalid parameter(all)
101API_EC_PARAM_API_KEYInvalid API key(all)
102API_EC_PARAM_SESSION_KEYSession key invalid or no longer valid(all)
103API_EC_PARAM_CALL_IDCall_id must be greater than previous
104API_EC_PARAM_SIGNATUREIncorrect signature(all)
105API_EC_PARAM_TOO_MANYThe number of parameters exceeded the maximum for this operation
110API_EC_PARAM_USER_IDInvalid user idphotos.addTag
111API_EC_PARAM_USER_FIELDInvalid user info field
112API_EC_PARAM_SOCIAL_FIELDInvalid user field
113API_EC_PARAM_EMAILInvalid email
114API_EC_PARAM_USER_ID_LISTInvalid user ID list
115API_EC_PARAM_FIELD_LISTInvalid field list
120API_EC_PARAM_ALBUM_IDInvalid album id
121API_EC_PARAM_PHOTO_IDInvalid photo id
130API_EC_PARAM_FEED_PRIORITYInvalid feed publication priority
140API_EC_PARAM_CATEGORYInvalid category
141API_EC_PARAM_SUBCATEGORYInvalid subcategory
142API_EC_PARAM_TITLEInvalid title
143API_EC_PARAM_DESCRIPTIONInvalid description
144API_EC_PARAM_BAD_JSONMalformed JSON string
150API_EC_PARAM_BAD_EIDInvalid eid
151API_EC_PARAM_UNKNOWN_CITYUnknown city
152API_EC_PARAM_BAD_PAGE_TYPEInvalid page type
170API_EC_PARAM_BAD_LOCALEInvalid locale
180API_EC_PARAM_BLOCKED_NOTIFICATIONThis notification was not delieved
190API_EC_PARAM_ACCESS_TOKENInvalid OAuth 2.0 Access Token

User Permission Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
200API_EC_PERMISSIONPermissions error
210API_EC_PERMISSION_USERUser not visible
211API_EC_PERMISSION_NO_DEVELOPERSApplication has no developers.admin.setAppProperties
212API_EC_PERMISSION_OFFLINE_ACCESSRenewing a session offline requires the extended permission offline_access
220API_EC_PERMISSION_ALBUMAlbum or albums not visible
221API_EC_PERMISSION_PHOTOPhoto not visible
230API_EC_PERMISSION_MESSAGEPermissions disallow message to user
240API_EC_PERMISSION_MARKUP_OTHER_USERDesktop applications cannot set FBML for other users
250API_EC_PERMISSION_STATUS_UPDATEUpdating status requires the extended permission status_update.users.setStatus
260API_EC_PERMISSION_PHOTO_UPLOADModifying existing photos requires the extended permission photo_uploadphotos.upload,photos.addTag
261API_EC_PERMISSION_VIDEO_UPLOADModifying existing photos requires the extended permission photo_uploadphotos.upload,photos.addTag
270API_EC_PERMISSION_SMSPermissions disallow sms to user.
280API_EC_PERMISSION_CREATE_LISTINGCreating and modifying listings requires the extended permission create_listing
281API_EC_PERMISSION_CREATE_NOTEManaging notes requires the extended permission create_note.
282API_EC_PERMISSION_SHARE_ITEMManaging shared items requires the extended permission share_item.
290API_EC_PERMISSION_EVENTCreating and modifying events requires the extended permission create_eventevents.create, events.edit
291API_EC_PERMISSION_LARGE_FBML_TEMPLATEFBML Template isn\'t owned by your application.
292API_EC_PERMISSION_LIVEMESSAGEAn application is only allowed to send LiveMessages to users who have accepted the TOS for that application.liveMessage.send
293API_EC_PERMISSION_XMPP_LOGINLogging in to chat requires the extended permission xmpp_loginIntegrating with FacebookChat
294API_EC_PERMISSION_ADS_MANAGEMENTManaging advertisements requires the extended permission ads_management, and a participating API keyAds API
296API_EC_PERMISSION_CREATE_EVENTManaging events requires the extended permission create_eventAPI#Events_API_Methods
298API_EC_PERMISSION_READ_MAILBOXReading mailbox messages requires the extended permission read_mailboxmessage.getThreadsInFolder
299API_EC_PERMISSION_RSVP_EVENTRSVPing to events requires the extended permission create_rsvpevents.rsvp

Data Editing Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
300API_EC_EDITEdit failure
310API_EC_EDIT_USER_DATAUser data edit failure
320API_EC_EDIT_PHOTOPhoto edit failure
321API_EC_EDIT_ALBUM_SIZEAlbum is full
322API_EC_EDIT_PHOTO_TAG_SUBJECTInvalid photo tag subject
323API_EC_EDIT_PHOTO_TAG_PHOTOCannot tag photo already visible on Facebook
324API_EC_EDIT_PHOTO_FILEMissing or invalid image file
325API_EC_EDIT_PHOTO_PENDING_LIMITToo many unapproved photos pending
326API_EC_EDIT_PHOTO_TAG_LIMITToo many photo tags pending
327API_EC_EDIT_ALBUM_REORDER_PHOTO_NOT_IN_ALBUMInput array contains a photo not in the album
328API_EC_EDIT_ALBUM_REORDER_TOO_FEW_PHOTOSInput array has too few photos
329API_EC_MALFORMED_MARKUPTemplate data must be a JSON-encoded dictionary, of the form {\'key-1\': \'value-1\', \'key-2\': \'value-2\', ...}
330API_EC_EDIT_MARKUPFailed to set markup
340API_EC_EDIT_FEED_TOO_MANY_USER_CALLSFeed publication request limit reached
341API_EC_EDIT_FEED_TOO_MANY_USER_ACTION_CALLSFeed action request limit reached
342API_EC_EDIT_FEED_TITLE_LINKFeed story title can have at most one href anchor
343API_EC_EDIT_FEED_TITLE_LENGTHFeed story title is too long
344API_EC_EDIT_FEED_TITLE_NAMEFeed story title can have at most one fb:userlink and must be of the user whose action is being reported
345API_EC_EDIT_FEED_TITLE_BLANKFeed story title rendered as blank
346API_EC_EDIT_FEED_BODY_LENGTHFeed story body is too long
347API_EC_EDIT_FEED_PHOTO_SRCFeed story photo could not be accessed or proxied
348API_EC_EDIT_FEED_PHOTO_LINKFeed story photo link invalid
350API_EC_EDIT_VIDEO_SIZEVideo file is too largevideo.upload
351API_EC_EDIT_VIDEO_INVALID_FILEVideo file was corrupt or invalidvideo.upload
352API_EC_EDIT_VIDEO_INVALID_TYPEVideo file format is not supportedvideo.upload
353API_EC_EDIT_VIDEO_FILEMissing video filevideo.upload
354API_EC_EDIT_VIDEO_NOT_TAGGEDUser is not tagged in this video
355API_EC_EDIT_VIDEO_ALREADY_TAGGEDUser is already tagged in this video
360API_EC_EDIT_FEED_TITLE_ARRAYFeed story title_data argument was not a valid JSON-encoded array
361API_EC_EDIT_FEED_TITLE_PARAMSFeed story title template either missing required parameters, or did not have all parameters defined in title_data array
362API_EC_EDIT_FEED_BODY_ARRAYFeed story body_data argument was not a valid JSON-encoded array
363API_EC_EDIT_FEED_BODY_PARAMSFeed story body template either missing required parameters, or did not have all parameters defined in body_data array
364API_EC_EDIT_FEED_PHOTOFeed story photos could not be retrieved, or bad image links were provided
365API_EC_EDIT_FEED_TEMPLATEThe template for this story does not match any templates registered for this application
366API_EC_EDIT_FEED_TARGETOne or more of the target ids for this story are invalid. They must all be ids of friends of the acting user
367API_EC_EDIT_FEED_MARKUPThe template data provided doesn't cover the entire token set needed to publish the story
370API_EC_USERS_CREATE_INVALID_EMAILThe email address you provided is not a valid email address
371API_EC_USERS_CREATE_EXISTING_EMAILThe email address you provided belongs to an existing account
372API_EC_USERS_CREATE_BIRTHDAYThe birthday provided is not valid
373API_EC_USERS_CREATE_PASSWORDThe password provided is too short or weak
374API_EC_USERS_REGISTER_INVALID_CREDENTIALThe login credential you provided is invalid.
375API_EC_USERS_REGISTER_CONF_FAILUREFailed to send confirmation message to the specified login credential.
376API_EC_USERS_REGISTER_EXISTINGThe login credential you provided belongs to an existing account
377API_EC_USERS_REGISTER_DEFAULT_ERRORSorry, we were unable to process your registration.
378API_EC_USERS_REGISTER_PASSWORD_BLANKYour password cannot be blank. Please try another.
379API_EC_USERS_REGISTER_PASSWORD_INVALID_CHARSYour password contains invalid characters. Please try another.
380API_EC_USERS_REGISTER_PASSWORD_SHORTYour password must be at least 6 characters long. Please try another.
381API_EC_USERS_REGISTER_PASSWORD_WEAKYour password should be more secure. Please try another.
382API_EC_USERS_REGISTER_USERNAME_ERROROur automated system will not approve this name.
383API_EC_USERS_REGISTER_MISSING_INPUTYou must fill in all of the fields.
384API_EC_USERS_REGISTER_INCOMPLETE_BDAYYou must indicate your full birthday to register.
385API_EC_USERS_REGISTER_INVALID_EMAILPlease enter a valid email address.
386API_EC_USERS_REGISTER_EMAIL_DISABLEDThe email address you entered has been disabled. Please contact disabled@facebook.com with any questions.
387API_EC_USERS_REGISTER_ADD_USER_FAILEDThere was an error with your registration. Please try registering again.
388API_EC_USERS_REGISTER_NO_GENDERPlease select either Male or Female.

Authentication Errors

Error numberPHP Constant nameError descriptionGenerated by methods
400API_EC_AUTH_EMAILInvalid email address
401API_EC_AUTH_LOGINInvalid username or password
402API_EC_AUTH_SIGInvalid application auth sig
403API_EC_AUTH_TIMEInvalid timestamp for authentication

Session Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
450API_EC_SESSION_TIMED_OUTSession key specified has passed its expiration time
451API_EC_SESSION_METHODSession key specified cannot be used to call this method
452API_EC_SESSION_INVALIDSession key invalid. This could be because the session key has an incorrect format, or because the user has revoked this session
453API_EC_SESSION_REQUIREDA session key is required for calling this method
454API_EC_SESSION_REQUIRED_FOR_SECRETA session key must be specified when request is signed with a session secret
455API_EC_SESSION_CANNOT_USE_SESSION_SECRETA session secret is not permitted to be used with this type of session key

Application Messaging Errors

Error numberPHP Constant nameError descriptionGenerated by methods
500API_EC_MESG_BANNEDMessage contains banned content
501API_EC_MESG_NO_BODYMissing message body
502API_EC_MESG_TOO_LONGMessage is too long
503API_EC_MESG_RATEUser has sent too many messages
504API_EC_MESG_INVALID_THREADInvalid reply thread id
505API_EC_MESG_INVALID_RECIPInvalid message recipient
510API_EC_POKE_INVALID_RECIPInvalid poke recipient
511API_EC_POKE_OUTSTANDINGThere is a poke already outstanding
512API_EC_POKE_RATEUser is poking too fast
513API_EC_POKE_USER_BLOCKEDUser cannot poke via API

FQL Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
600FQL_EC_UNKNOWN_ERRORAn unknown error occurred in FQLfql.query,fql.multiquery
601FQL_EC_PARSER_ERRORError while parsing FQL statementfql.query,fql.multiquery
602FQL_EC_UNKNOWN_FIELDThe field you requested does not existfql.query,fql.multiquery
603FQL_EC_UNKNOWN_TABLEThe table you requested does not existfql.query,fql.multiquery
604FQL_EC_NO_INDEXYour statement is not indexablefql.query,fql.multiquery
605FQL_EC_UNKNOWN_FUNCTIONThe function you called does not existfql.query,fql.multiquery
606FQL_EC_INVALID_PARAMWrong number of arguments passed into the functionfql.query,fql.multiquery
607FQL_EC_INVALID_FIELDFQL field specified is invalid in this context.fql.query*,fql.multiquery
608FQL_EC_INVALID_SESSIONAn invalid session was specifiedfql.query,fql.multiquery
609FQL_EC_UNSUPPORTED_APP_TYPEFQL field specified is invalid in this context.fql.query*,fql.multiquery
610FQL_EC_SESSION_SECRET_NOT_ALLOWEDFQL field specified is invalid in this context.fql.query*,fql.multiquery
611FQL_EC_DEPRECATED_TABLEFQL field specified is invalid in this context.fql.query*,fql.multiquery
612FQL_EC_EXTENDED_PERMISSIONThe stream requires an extended permissionfql.query,fql.multiquery
613FQL_EC_RATE_LIMIT_EXCEEDEDCalls to stream have exceeded the rate of 100 calls per 600 seconds.fql.query,fql.multiquery
614FQL_EC_UNRESOLVED_DEPENDENCYUnresolved dependency in multiqueryfql.multiquery
615FQL_EC_INVALID_SEARCHThis search is invalidfql.query,fql.multiquery
617FQL_EC_TOO_MANY_FRIENDS_FOR_PRELOADThe user you queried against has too many friends to be used with Preload FQL, in order to avoid out of memory errorsfql.query,fql.multiquery

* This error is returned when the field name is sometimes valid, but not all the time. For example, if you run fql.query on the Metrics FQL table, you can get this error because some metrics are queryable only over the daily period, as opposed to the weekly or monthly periods.

Ref Errors

Error numberPHP Constant nameError descriptionGenerated by methods
700API_EC_REF_SET_FAILEDUnknown failure in storing ref data. Please try again.

Application Integration Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
750API_EC_FB_APP_UNKNOWN_ERRORUnknown Facebook application integration failure.
751API_EC_FB_APP_FETCH_FAILEDFetch from remote site failed.
752API_EC_FB_APP_NO_DATAApplication returned no data. This may be expected or represent a connectivity error.
753API_EC_FB_APP_NO_PERMISSIONSApplication returned user had invalid permissions to complete the operation.
754API_EC_FB_APP_TAG_MISSINGApplication returned data, but no matching tag found. This may be expected.
755API_EC_FB_APP_DB_FAILUREThe database for this object failed.

Data Store API Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
800API_EC_DATA_UNKNOWN_ERRORUnknown data store API error
801API_EC_DATA_INVALID_OPERATIONInvalid operation
802API_EC_DATA_QUOTA_EXCEEDEDData store allowable quota was exceeded
803API_EC_DATA_OBJECT_NOT_FOUNDSpecified object cannot be found
804API_EC_DATA_OBJECT_ALREADY_EXISTSSpecified object already exists
805API_EC_DATA_DATABASE_ERRORA database error occurred. Please try again
806API_EC_DATA_CREATE_TEMPLATE_ERRORUnable to add FBML template to template database. Please try again.
807API_EC_DATA_TEMPLATE_EXISTS_ERRORNo active template bundle with that ID or handle exists.
808API_EC_DATA_TEMPLATE_HANDLE_TOO_LONGTemplate bundle handles must contain less than or equal to 32 characters.
809API_EC_DATA_TEMPLATE_HANDLE_ALREADY_IN_USETemplate bundle handle already identifies a previously registered template bundle, and handles can not be reused.
810API_EC_DATA_TOO_MANY_TEMPLATE_BUNDLESApplication has too many active template bundles, and some must be deactivated before new ones can be registered.
811API_EC_DATA_MALFORMED_ACTION_LINKOne of more of the supplied action links was improperly formatted.
812API_EC_DATA_TEMPLATE_USES_RESERVED_TOKENOne …or more of your templates is using a token reserved by Facebook, such as {*mp3*} or {*video*}.

Mobile/SMS Errors

Error numberPHP Constant nameError descriptionGenerated by methods
850API_EC_SMS_INVALID_SESSIONInvalid sms session.
851API_EC_SMS_MSG_LENInvalid sms message length.
852API_EC_SMS_USER_QUOTAOver user daily sms quota.
853API_EC_SMS_USER_ASLEEPUnable to send sms to user at this time.
854API_EC_SMS_APP_QUOTAOver application daily sms quota/rate limit.
855API_EC_SMS_NOT_REGISTEREDUser is not registered for Facebook Mobile Texts
856API_EC_SMS_NOTIFICATIONS_OFFUser has SMS notifications turned off
857API_EC_SMS_CARRIER_DISABLESMS application disallowed by mobile operator

Application Information Errors

Error numberPHP Constant nameError descriptionGenerated by methods
900API_EC_NO_SUCH_APPNo such application exists.

Batch API Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
950API_BATCH_TOO_MANY_ITEMSEach batch API can not contain more than 20 items
951API_EC_BATCH_ALREADY_STARTEDbegin_batch already called, please make sure to call end_batch first.
952API_EC_BATCH_NOT_STARTEDend_batch called before begin_batch.
953API_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODEThis method is not allowed in batch mode.

Events API Errors

Error numberPHP Constant nameError descriptionGenerated by methods
1000API_EC_EVENT_INVALID_TIMEInvalid time for an event.events.edit
1001API_EC_EVENT_NAME_LOCKEDYou are no longer able to change the name of this event.events.edit

Info Section Errors

Error numberPHP Constant nameError descriptionGenerated by methods
1050API_EC_INFO_NO_INFORMATIONNo information has been set for this userprofile.setInfo
1051API_EC_INFO_SET_FAILEDSetting info failed. Check the formatting of your info fields.profile.setInfo

LiveMessage Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
1100API_EC_LIVEMESSAGE_SEND_FAILEDAn error occurred while sending the LiveMessage.liveMessage.send
1101API_EC_LIVEMESSAGE_EVENT_NAME_TOO_LONGThe event_name parameter must be no longer than 128 bytes.liveMessage.send
1102API_EC_LIVEMESSAGE_MESSAGE_TOO_LONGThe message parameter must be no longer than 1024 bytes.liveMessage.send

Chat Errors

Error numberPHP Constant nameError descriptionGenerated by methods
1200API_EC_CHAT_SEND_FAILEDAn error occurred while sending the message.

Facebook Page Errors

Error numberPHP Constant nameError descriptionGenerated by methods
1201API_EC_PAGES_CREATEYou have created too many pages

Facebook Links Errors

Error numberPHP Constant nameError descriptionGenerated by methods
1500API_EC_SHARE_BAD_URLThe url you supplied is invalid

Facebook Notes Errors

Error numberPHP Constant nameError descriptionGenerated by methods
1600API_EC_NOTE_CANNOT_MODIFYThe user does not have permission to modify this note.

Comment Errors

ErrornumberPHP Constant nameError descriptionGenerated by methods
1700API_EC_COMMENTS_UNKNOWNAn unknown error has occurred.
1701API_EC_COMMENTS_POST_TOO_LONGThe specified post was too long.
1702API_EC_COMMENTS_DB_DOWNThe comments database is down.
1703API_EC_COMMENTS_INVALID_XIDThe specified xid is not valid. xids can only contain letters, numbers, and underscores
1704API_EC_COMMENTS_INVALID_UIDThe specified user is not a user of this application
1705API_EC_COMMENTS_INVALID_POSTThere was an error during posting.
1706API_EC_COMMENTS_INVALID_REMOVEWhile attempting to remove the post.

转载于:https://www.cnblogs.com/cosnis/archive/2011/01/06/1927545.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值